/* ============================================================
   时空闯关（游戏）· 专属样式
   颜色一律取站点主题变量（themes.css 11 套皮肤自动适配），
   不写死任何面色；布局只作用于 #game 页内，不影响其他栏目。
   ============================================================ */

#game .g-wrap { max-width: 1080px; margin: 0 auto; }

/* ---- 通用：水墨卡片 ---- */
.g-card {
  background: var(--cardF, var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 14px rgba(0,0,0,.06);
}
.g-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.g-head b { font-size: 15px; letter-spacing: 2px; color: var(--accent); }
.g-head span { font-size: 12px; color: var(--tx3); }

/* ---- 标题屏 ---- */
.g-intro { text-align: center; padding: 30px 16px 40px; position: relative; }
.g-intro .g-banner {
  max-width: 640px; width: 78%; margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.18));
}
.g-intro .g-banner-abs {
  position: absolute; left: 50%; top: 96px; transform: translateX(-50%);
  font-size: clamp(26px, 5vw, 44px); letter-spacing: 10px; font-weight: 700;
  color: var(--accent); text-shadow: 0 1px 0 var(--panel), 0 0 24px rgba(var(--accentRGB), .85);
  pointer-events: none; white-space: nowrap;
}
.g-intro p.g-lead { max-width: 560px; margin: 18px auto 4px; color: var(--tx2); font-size: 13.5px; line-height: 1.9; }
.g-intro .g-start-row { margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- 角色创建 ---- */
.g-create-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 16px;
}
.g-skin {
  border: 2px solid var(--line); border-radius: 14px; cursor: pointer;
  background: var(--panel2); padding: 10px 8px 12px; text-align: center;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  position: relative; overflow: hidden;
}
.g-skin img { width: 100%; height: 180px; object-fit: contain; transition: transform .25s; }
.g-skin:hover { transform: translateY(-4px); }
.g-skin:hover img { transform: scale(1.05); }
.g-skin.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accentRGB), .9) inset 0 0 0; box-shadow: 0 0 18px rgba(var(--accentRGB), .6); }
.g-skin.sel::after {
  content: '✓'; position: absolute; right: 10px; top: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--onAccent, #fff);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.g-skin .g-skin-name { font-size: 13.5px; color: var(--tx); margin-top: 6px; letter-spacing: 1px; }
.g-skin .g-skin-tag { font-size: 11px; color: var(--tx3); }

/* ---- 朝代长河（选关） ---- */
.g-era-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g-era {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--panel); transition: transform .2s, box-shadow .2s; position: relative;
}
.g-era:hover { transform: translateY(-5px); box-shadow: 0 10px 26px rgba(0,0,0,.16); }
.g-era img { width: 100%; height: 150px; object-fit: cover; display: block; }
.g-era .g-era-body { padding: 12px 14px 14px; }
.g-era .g-era-name { font-size: 15px; letter-spacing: 2px; color: var(--tx); }
.g-era .g-era-sub { font-size: 12px; color: var(--tx3); margin-top: 4px; }
.g-era .g-era-best { position: absolute; top: 10px; left: 10px; font-size: 11px;
  background: var(--accent); color: var(--onAccent, #fff); border-radius: 20px; padding: 3px 10px; }
.g-era .g-era-lock { position: absolute; inset: 0; background: var(--mask, rgba(0,0,0,.55));
  display: flex; align-items: center; justify-content: center; color: var(--tx); font-size: 13px; letter-spacing: 2px; }

/* ---- 战绩 / 排行 / 组队 ---- */
.g-dash { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-top: 14px; }
.g-stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.g-stat { flex: 1; min-width: 90px; text-align: center; background: var(--panel2); border-radius: 10px; padding: 10px 6px; }
.g-stat .n { font-size: 22px; color: var(--accent2); font-weight: 700; }
.g-stat .l { font-size: 11px; color: var(--tx3); margin-top: 2px; }
.g-lb-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 12.5px; border-bottom: 1px dashed var(--line2); }
.g-lb-row:last-child { border-bottom: none; }
.g-lb-row .r { width: 26px; color: var(--tx3); }
.g-lb-row .nm { flex: 1; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-lb-row .sc { color: var(--accent2); }
.g-lb-row.me { background: var(--panel2); border-radius: 8px; }
.g-code-input { width: 110px; }
.g-party-code { font-size: 26px; letter-spacing: 8px; color: var(--accent); font-weight: 700; }

/* ---- 游戏画布 ---- */
.g-stage { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--deep); }
.g-stage canvas { display: block; width: 100%; height: auto; touch-action: none; }
.g-hud-tip {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  background: var(--tipBg); color: var(--tx); font-size: 12.5px; padding: 6px 16px;
  border-radius: 20px; pointer-events: none; opacity: .92; white-space: nowrap;
}
.g-meet-toast {
  position: absolute; right: 14px; top: 44px; font-size: 12px; color: var(--accent2);
  background: var(--tipBg); border: 1px solid var(--line); padding: 6px 12px; border-radius: 10px;
  opacity: 0; transition: opacity .5s; pointer-events: none; max-width: 240px;
}
.g-meet-toast.show { opacity: 1; }

/* 触屏按钮（窄屏显示） */
.g-touch { position: absolute; inset: 0; pointer-events: none; display: none; }
.g-touch button {
  pointer-events: auto; position: absolute; bottom: 12px; width: 52px; height: 52px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--tipBg);
  color: var(--tx); font-size: 18px; opacity: .82;
}
.g-touch .t-l { left: 14px; } .g-touch .t-r { left: 80px; }
.g-touch .t-a { right: 80px; } .g-touch .t-j { right: 14px; }
@media (pointer: coarse) { .g-touch { display: block; } }

/* ---- 答题弹层 ---- */
.g-quiz-mask {
  position: absolute; inset: 0; background: var(--mask, rgba(10,10,12,.62));
  display: flex; align-items: center; justify-content: center; z-index: 5;
}
.g-quiz { width: min(560px, 92%); position: relative; }
.g-quiz img.g-quiz-scroll { width: 100%; display: block; filter: drop-shadow(0 10px 30px rgba(0,0,0,.35)); }
.g-quiz .g-quiz-body { position: absolute; inset: 12% 9% 16%; display: flex; flex-direction: column; }
.g-quiz .g-q-title { font-size: 15px; color: var(--tx); font-weight: 600; line-height: 1.7; margin-bottom: 12px; }
.g-quiz .g-q-opts { display: flex; flex-direction: column; gap: 8px; }
.g-quiz button.g-opt {
  text-align: left; padding: 9px 14px; border-radius: 10px; font-size: 13.5px;
  border: 1px solid var(--line); background: var(--panel); color: var(--tx); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.g-quiz button.g-opt:hover { border-color: var(--accent); }
.g-quiz button.g-opt.ok { background: var(--jadeTx, rgba(80,160,110,.18)); border-color: var(--jade); color: var(--jadeTx, var(--jade)); }
.g-quiz button.g-opt.bad { background: var(--redTx, rgba(190,80,80,.15)); border-color: var(--red); }
.g-quiz .g-q-learn { margin-top: auto; font-size: 12px; color: var(--tx2); line-height: 1.7; min-height: 34px; }

/* ---- 结算 ---- */
.g-result-mask {
  position: absolute; inset: 0; background: var(--mask, rgba(10,10,12,.6));
  display: flex; align-items: center; justify-content: center; z-index: 6;
}
.g-result { width: min(620px, 94%); position: relative; }
.g-result img.g-result-scroll { width: 100%; display: block; }
.g-result .g-result-body { position: absolute; inset: 14% 10% 18%; text-align: center; display: flex; flex-direction: column; }
.g-result .g-r-title { font-size: 24px; letter-spacing: 8px; color: var(--accent); font-weight: 700; }
.g-result .g-r-sub { font-size: 12px; color: var(--tx3); margin-top: 4px; }
.g-result .g-r-stats { display: flex; justify-content: center; gap: 26px; margin: 18px 0 8px; }
.g-result .g-r-stats .n { font-size: 26px; color: var(--tx); font-weight: 700; }
.g-result .g-r-stats .l { font-size: 11px; color: var(--tx3); }
.g-result .g-r-earned { font-size: 14px; color: var(--jade); margin: 4px 0; }
.g-result .g-r-badges { font-size: 12px; color: var(--accent2); min-height: 20px; }
.g-result .g-r-acts { margin-top: auto; display: flex; gap: 10px; justify-content: center; }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .g-create-grid { grid-template-columns: repeat(2, 1fr); }
  .g-era-grid { grid-template-columns: 1fr; }
  .g-dash { grid-template-columns: 1fr; }
  .g-skin img { height: 150px; }
}
