/* =========================================================
   GLASS PLAY — 主题与毛玻璃系统
   所有站点级覆盖请改 CSS 变量（见布局注入或 config/sites.php）
   ========================================================= */
:root {
  /* 主题变量：多站点可覆盖 */
  --gp-bg: #E8F0FF;
  --gp-white: #FFFFFF;
  --gp-accent: #7C6CFF;
  --gp-accent-soft: rgba(124, 108, 255, .16);
  --gp-ink: #1B1F3B;
  --gp-ink-soft: rgba(27, 31, 59, .56);
  --gp-glass: rgba(255, 255, 255, .55);
  --gp-glass-strong: rgba(255, 255, 255, .78);
  --gp-border: rgba(255, 255, 255, .65);
  --gp-radius: 24px;
  --gp-blur: 22px;
  --gp-shadow: 0 20px 60px rgba(124, 108, 255, .18);
  --gp-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { font-family: var(--gp-font); }

html { -webkit-text-size-adjust: 100%; }

body {
  font-weight: 300;
  color: var(--gp-ink);
  background: linear-gradient(160deg, var(--gp-bg) 0%, var(--gp-white) 52%, #F4F0FF 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: .01em;
}

/* ---------- 背景光晕（浮动） ---------- */
.gp-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.gp-orb  { position: absolute; border-radius: 9999px; filter: blur(70px); opacity: .55; animation: gp-float 9s ease-in-out infinite; }
.gp-orb-a { width: 44vw; height: 44vw; top: -12vw; left: -10vw; background: radial-gradient(circle, rgba(124,108,255,.4), transparent 70%); }
.gp-orb-b { width: 36vw; height: 36vw; bottom: -10vw; right: -8vw; background: radial-gradient(circle, rgba(158,201,255,.5), transparent 70%); animation-delay: -3s; }
.gp-orb-c { width: 22vw; height: 22vw; top: 36%; left: 56%; background: radial-gradient(circle, #fff, transparent 70%); animation-delay: -6s; }

@keyframes gp-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-22px); }
}

/* ---------- 毛玻璃卡片 ---------- */
.glass {
  background: var(--gp-glass);
  -webkit-backdrop-filter: blur(var(--gp-blur)) saturate(180%);
  backdrop-filter: blur(var(--gp-blur)) saturate(180%);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
  box-shadow: var(--gp-shadow), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), box-shadow .5s ease, background .5s ease;
}
.glass-hover:hover { transform: translateY(-6px); box-shadow: 0 30px 80px rgba(124, 108, 255, .28), inset 0 1px 0 rgba(255,255,255,.8); }

/* 渐变描边光晕 */
.glow { position: relative; }
.glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(124,108,255,.55), rgba(255,255,255,.12) 40%, rgba(158,208,255,.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.glow-soft { box-shadow: 0 0 40px rgba(124, 108, 255, .25), var(--gp-shadow); }

.gp-float { animation: gp-float 7s ease-in-out infinite; }

/* ---------- 文字 ---------- */
.gp-title-gradient {
  background: linear-gradient(120deg, var(--gp-ink) 20%, var(--gp-accent) 60%, #9EC9FF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gp-muted { color: var(--gp-ink-soft); }

/* ---------- 按钮 ---------- */
.gp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 9999px; padding: .7rem 1.6rem; font-size: .9rem; font-weight: 400;
  border: 1px solid var(--gp-border); cursor: pointer; user-select: none;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s, background .35s;
}
.gp-btn:active { transform: scale(.96); }
.gp-btn-primary {
  color: #fff; border: none;
  background: linear-gradient(135deg, var(--gp-accent), #9D8FFF);
  box-shadow: 0 10px 30px rgba(124, 108, 255, .4);
}
.gp-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(124,108,255,.5); }
.gp-btn-ghost { background: rgba(255,255,255,.5); color: var(--gp-ink); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.gp-btn-ghost:hover { background: rgba(255,255,255,.75); }

.gp-icon-btn {
  width: 40px; height: 40px; border-radius: 9999px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--gp-ink);
  background: rgba(255,255,255,.55); border: 1px solid var(--gp-border);
  cursor: pointer; transition: background .3s, transform .3s, color .3s;
}
.gp-icon-btn:hover { background: rgba(255,255,255,.85); transform: translateY(-1px); }
.gp-icon-btn.is-off { color: var(--gp-ink-soft); opacity: .55; }
.gp-icon-btn.is-paused { background: var(--gp-accent); color: #fff; }

/* ---------- 游戏舞台 ---------- */
.game-stage {
  position: relative; border-radius: 18px; overflow: hidden;
  aspect-ratio: var(--gp-aspect, 1 / 1);
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(255,255,255,.85), rgba(232,240,255,.35)),
    rgba(255, 255, 255, .4);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 2px 20px rgba(124,108,255,.08);
}
.game-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }

.game-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  text-align: center; padding: 1rem;
}
.game-overlay.hidden { display: none; }
.game-overlay .ov-title { font-size: 1.35rem; font-weight: 300; letter-spacing: .08em; }
.game-overlay .ov-hint  { font-size: .8rem; color: var(--gp-ink-soft); }

/* 全屏时容器铺满 */
.game-shell:fullscreen { border-radius: 0; overflow-y: auto; padding: 1rem; }
.game-shell:fullscreen .game-stage { max-height: 82vh; margin-inline: auto; }

/* ---------- 导航 ---------- */
.gp-nav {
  position: sticky; top: 12px; z-index: 50;
  margin: 12px auto 0; width: min(1100px, calc(100% - 2rem));
  border-radius: 9999px; padding: .55rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.gp-nav a { transition: color .3s; }
.gp-nav a:hover { color: var(--gp-accent); }
.gp-nav .gp-link-active { color: var(--gp-accent); }

/* ---------- 游戏封面缩略 ---------- */
.gp-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 18px 18px 0 0; }
.gp-thumb svg { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; color: rgba(255,255,255,.9); filter: drop-shadow(0 6px 18px rgba(0,0,0,.15)); }
.gp-thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 90% at 70% 10%, rgba(255,255,255,.35), transparent 60%); }
.thumb-snake   { background: linear-gradient(135deg, #7C6CFF, #9EC9FF); }
.thumb-breakout{ background: linear-gradient(135deg, #9D8FFF, #FFC9EC); }
.thumb-g2048   { background: linear-gradient(135deg, #6C9FFF, #B7F0E4); }

/* =========================================================
   移动端与低性能降级
   ========================================================= */
@media (max-width: 768px) {
  :root { --gp-blur: 12px; --gp-radius: 20px; --gp-shadow: 0 12px 36px rgba(124,108,255,.15); }
  .gp-orb { filter: blur(46px); opacity: .38; }
  .glass-hover:hover { transform: none; } /* 触屏无悬停位移 */
}

@media (prefers-reduced-motion: reduce) {
  .gp-orb, .gp-float { animation: none !important; }
  .glass { transition: none; }
}

/* JS 判定低端设备后加 .gp-low：彻底关闭 backdrop-filter 与光晕 */
.gp-low .glass,
.gp-low .gp-nav,
.gp-low .game-overlay,
.gp-low .gp-btn-ghost {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background: var(--gp-glass-strong);
}
.gp-low .gp-orbs { display: none; }
.gp-low .glow::before { display: none; }
