/* =========================================================
   众行健身 · 放松一下 游戏页公共样式
   所有小游戏页面共用。新增游戏时：直接 link 本文件，
   移动端性能优化(防滚动/防回弹/减特效)自动生效。
   ========================================================= */

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
    background: #050510;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior: none; /* 滑动边界不触发页面回弹 */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ========== 背景光斑（位置/颜色由各游戏页自定义 .orb-x） ========== */
.bg-orbs {
    position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.orb {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.3;
    animation: orbFloat 18s ease-in-out infinite alternate;
}
@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(36px, -26px) scale(1.12); }
}

/* ========== 顶部栏 ========== */
.topbar {
    position: relative; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 30px;
    background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
}
.back {
    color: #ccc; text-decoration: none; font-size: 0.92rem;
    padding: 8px 16px; border: 1px solid rgba(255,255,255,0.18);
    border-radius: 25px; backdrop-filter: blur(10px); transition: all 0.3s; white-space: nowrap;
}
.back:hover { color: #FFD700; border-color: rgba(255,215,0,0.5); }
.topbar-title {
    font-size: 1.25rem; font-weight: 700; color: #FFD700;
    text-shadow: 0 0 18px rgba(255,215,0,0.35); letter-spacing: 0.1rem;
}

/* ========== 按钮 ========== */
.btn {
    padding: 8px 18px; border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08);
    color: #fff; font-size: 0.92rem; cursor: pointer;
    backdrop-filter: blur(10px); transition: all 0.3s; font-family: inherit; white-space: nowrap;
}
.btn:hover { border-color: rgba(255,215,0,0.6); background: rgba(255,215,0,0.12); color: #FFD700; }
.btn.primary {
    background: linear-gradient(120deg, #FFD700, #FFB347); color: #1a1500;
    font-weight: 700; border: none; padding: 10px 30px;
    box-shadow: 0 8px 24px rgba(255,215,0,0.3);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,215,0,0.4); }

/* ========== 游戏主体 ========== */
.game-shell {
    position: relative; z-index: 10; max-width: 520px; margin: 0 auto; padding: 18px 16px 60px;
}

/* ========== HUD（间距等细微差异由各游戏页覆盖） ========== */
.hud {
    display: flex; justify-content: center; align-items: center; gap: 40px; margin-bottom: 18px;
}
.hud-item { text-align: center; }
.hud-label {
    display: block; font-size: 0.78rem; color: rgba(255,255,255,0.5);
    letter-spacing: 0.15rem; margin-bottom: 4px;
}
.hud-value {
    font-size: 1.6rem; font-weight: 800; color: #FFD700;
    text-shadow: 0 0 18px rgba(255,215,0,0.35); font-variant-numeric: tabular-nums;
}

/* ========== 棋盘容器（宽度/比例由各游戏页覆盖） ========== */
.board-wrap {
    position: relative; width: min(100%, 480px); margin: 0 auto;
    aspect-ratio: 1 / 1; border-radius: 22px; padding: 10px;
    background: linear-gradient(160deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 0 40px rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
    touch-action: none; /* 防止滑动棋盘时页面滚动 */
}

/* ========== 覆盖层 ========== */
.overlay {
    position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
    background: rgba(4, 5, 12, 0.72); border-radius: 22px;
    backdrop-filter: blur(6px); z-index: 20;
}
.overlay.show { display: flex; }
.overlay-box {
    text-align: center; padding: 34px 44px; border-radius: 22px;
    background: rgba(20, 24, 40, 0.92); border: 1px solid rgba(255,215,0,0.25);
    box-shadow: 0 0 60px rgba(255,215,0,0.12);
}
.overlay-title {
    font-size: 1.7rem; font-weight: 800; margin-bottom: 10px;
    color: #FFD700; letter-spacing: 0.2rem;
}
.overlay-score { font-size: 1rem; color: rgba(255,255,255,0.7); margin-bottom: 22px; }
.overlay-score b { color: #fff; font-size: 1.3rem; }

/* ========== 操作提示 ========== */
.hint {
    text-align: center; margin-top: 22px; font-size: 0.85rem;
    color: rgba(255,255,255,0.45); line-height: 1.9;
}

/* ========== 移动端：减特效 + 通用尺寸微调（性能优化，全游戏生效） ========== */
@media (max-width: 480px) {
    .orb { filter: blur(50px); opacity: 0.18; }
    .board-wrap, .topbar, .btn, .back { backdrop-filter: none; }
    .topbar { padding: 14px 14px; }
    .topbar-title { font-size: 1.05rem; }
    .back { font-size: 0.82rem; padding: 7px 12px; }
    .btn { font-size: 0.85rem; padding: 7px 14px; }
    .hud { gap: 30px; }
    .hud-value { font-size: 1.35rem; }
}