/* ==========================================================================
   NZEP 资料库 · assets/games/games.css —— 小游戏子站的样式（手机优先）
   --------------------------------------------------------------------------
   复用 st-body / st-bar / st-main / st-foot 那套"整屏应用外壳"
   （和 /sckn.html 同一套规矩：body 固定视口高、中间那条自己滚、页脚不压内容），
   再加小游戏自己的东西：**自己的导航栏（g-nav）**、大厅头部与卡片、资料快速编辑、
   论坛列表、房间头、棋盘容器、UNO 牌面、操作条。
   一条硬规矩：**所有可点区域在手机上至少 44×44**，棋盘格点按 12px 半径命中。
   断点实测口径：360 / 390 / 430 宽下**不许横向溢出**（见 tools/test-games-ui.js 的大厅那两条）。
   ========================================================================== */

/* ---------------------------------------------------------------- 顶条 */
.g-body .st-bar { position: sticky; top: 0; z-index: 30; }
.g-body #gWho strong { color: #fff; }

/* ================================================================ 小游戏导航栏
   用户要求（2026-10）：大厅要有**自己的导航栏**，栏里有「小游戏论坛」。
   独立于资料库那条顶栏（那一页是子站外壳），只在大厅 / 论坛 / 积分榜出现。
   手机：整条**换行**排（不横向滚动），每个可点项 ≥44px 高。 */
.g-nav {
  display: flex; align-items: center; gap: .3rem .45rem; flex-wrap: wrap;
  border: 1px solid var(--eg-b, #a2a9b1); background: #fff;
  padding: .35rem .5rem; margin: 0 0 .8rem; min-height: 52px;
}
.g-nav-brand {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--serif); font-size: 1rem; font-weight: 700; white-space: nowrap;
  color: var(--text-strong, #202122); text-decoration: none;
}
.g-nav-links { display: flex; align-items: center; gap: .1rem; flex-wrap: wrap; min-width: 0; }
.g-nav-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 .6rem; font-size: .86rem; white-space: nowrap;
  border: 1px solid transparent; border-radius: 2px; text-decoration: none; color: #3366cc;
}
.g-nav-link:hover { background: var(--bg-subtle, #f8f9fa); }
.g-nav-link.on { background: #eaf3ff; border-color: #3366cc; color: #2a54a8; font-weight: 700; }
.g-nav-who { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; min-width: 0; }
.g-nav-me {
  font-weight: 600; font-size: .86rem; max-width: 8em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-nav-login { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; color: #b26a00; font-size: .86rem; }
.g-nav-home { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .4rem; font-size: .84rem; text-decoration: none; }
@media (max-width: 480px) {
  .g-nav { gap: .15rem .3rem; padding: .3rem .45rem; }
  .g-nav-brand { font-size: .92rem; }
  .g-nav-link { padding: 0 .45rem; font-size: .82rem; min-height: 44px; }
  /* 手机上"回资料库"走页脚那条，别和三个链接抢一行（否则 360 宽会挤到换行两三次） */
  .g-nav-home { display: none; }
}

/* ---------------------------------------------------------------- 大厅 */
.g-wrap { padding: .2rem 0 0; }
/* SEO 正文（games.html 里写死的 #gRoot 内容）：给搜索引擎与无脚本环境看的真内容。
   games.js 渲染时整块替换，所以正常用户看不到；这里只管它单独出现时排得整齐。
   隐藏只在 games.js **真的跑起来**（html.g-boot）之后生效：脚本没加载上时正文照样看得见。 */
.g-seo { max-width: 46rem; }
html.g-boot .g-seo { display: none; }
.g-seo h1 { font-family: var(--serif); font-size: 1.5rem; margin: .3rem 0 .5rem; }
.g-seo h2 { font-family: var(--serif); font-size: 1.05rem; margin: 1rem 0 .4rem; }
.g-seo p { color: var(--text-2); font-size: .88rem; line-height: 1.9; margin: 0 0 .7rem; }
.g-seo code { font-family: var(--mono, monospace); font-size: .84rem; background: var(--bg-subtle, #f8f9fa); padding: 0 .2rem; }
.g-seo-list { margin: 0; padding-left: 1.2rem; }
.g-seo-list li { font-size: .86rem; line-height: 1.9; color: var(--text-2); }
.g-seo-list a { color: var(--link, #3366cc); }
.g-hero { margin: 0 0 .9rem; }
.g-title { font-family: var(--serif); font-size: 1.5rem; margin: .3rem 0 .1rem; }
.g-lead { color: var(--text-2); font-size: .88rem; line-height: 1.9; margin: 0 0 .9rem; }
/* 大厅里凡是做成"按钮样"的链接都要跟 .g-btn 长得一样（论坛入口 / 更多设置…） */
.g-wrap a.g-btn, .g-quick a.g-btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}

/* 一行"直达每个玩法"的徽章：手机上**横向整行换行**（不横向滚动），每个 ≥44px 高。
   360 宽实测：10 个徽章排成 3—4 行，页面不溢出。 */
.g-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .7rem; }
.g-chip {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 44px;
  padding: 0 .6rem; font-size: .84rem; white-space: nowrap; text-decoration: none;
  border: 1px solid var(--eg-b-soft, #c8ccd1); border-radius: 2px; background: #fff; color: var(--text);
}
.g-chip:hover { background: var(--bg-subtle, #f8f9fa); }
.g-chip .ic { font-size: 1rem; }
/* 徽章跳到卡片：给锚点留一点上边距，别被吸顶的顶条压住标题 */
.g-card { scroll-margin-top: 64px; }

.g-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .7rem; }
.g-card {
  border: 1px solid var(--eg-b, #a2a9b1); background: #fff; padding: .8rem .9rem;
  display: flex; flex-direction: column; gap: .45rem;
}
.g-card h3 { margin: 0; font-family: var(--serif); font-size: 1.08rem; display: flex; align-items: center; gap: .4rem; }
.g-card .icon { font-size: 1.15rem; }
.g-card p { margin: 0; color: var(--text-2); font-size: .82rem; line-height: 1.8; }
.g-card .meta { color: var(--text-3); font-size: .76rem; }
.g-card .ops { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; }

/* 操作按钮：手机上也够大 */
.g-btn {
  appearance: none; font-family: inherit; cursor: pointer; font-size: .84rem;
  border: 1px solid var(--eg-b, #a2a9b1); background: #fff; color: var(--text);
  padding: .5rem .8rem; min-height: 40px; border-radius: 2px; line-height: 1.4;
}
.g-btn:hover { background: var(--bg-subtle, #f8f9fa); }
.g-btn.primary { background: #3366cc; border-color: #2a54a8; color: #fff; }
.g-btn.primary:hover { background: #2a54a8; }
.g-btn.ghost { border-color: transparent; background: none; color: var(--link, #b01); }
.g-btn.danger { color: var(--bad, #b32424); border-color: #e6c3c3; }
.g-btn[disabled] { opacity: .45; cursor: not-allowed; }
.g-btn.big { min-height: 46px; font-size: .92rem; padding: .6rem 1.1rem; }

/* 「小游戏」启动页的入口卡（2026-10-11 起这一页只有这五张 + 我还在局里）：
   风格与拼点大厅对齐 —— 白卡、16px 圆角、衬线标题、红色"进入"、蓝色链接。
   手机上单列、整卡可点、最小高度 4.2rem（手指好按）。 */
.g-halls { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr)); margin: .3rem 0 .6rem; }
.g-hall {
  display: flex; align-items: center; gap: .8rem; padding: .85rem .95rem;
  background: #fff; border: 1px solid #e3e6ea; border-radius: 16px;
  text-decoration: none; color: #1a1c1f; min-height: 4.6rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.g-hall:hover { box-shadow: 0 6px 18px rgba(26, 28, 31, .10); transform: translateY(-2px); border-color: #cfd4da; }
.g-hall .ic { font-size: 1.9rem; line-height: 1; flex: 0 0 auto; }
.g-hall .tx { display: flex; flex-direction: column; gap: .18rem; flex: 1 1 auto; min-width: 0; }
.g-hall .tx b { font-size: 1.05rem; font-family: var(--serif, Georgia, serif); }
.g-hall .tx .ds { color: #4b5158; font-size: .8rem; line-height: 1.6; }
.g-hall .tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .1rem; }
.g-hall .tags i {
  font-style: normal; font-size: .72rem; color: #4b5158;
  border: 1px solid #cfd4da; border-radius: 999px; padding: 1px 8px; background: #f8f9fa;
}
.g-hall .go { flex: 0 0 auto; color: #b32424; font-weight: 700; font-size: .85rem; }
@media (max-width: 560px) {
  .g-hall { padding: .8rem .85rem; min-height: 4.2rem; align-items: flex-start; }
  .g-hall .ic { font-size: 1.6rem; }
  .g-hall .tx .ds { font-size: .78rem; }
}
/* 2026-10-25 用户要求：危情应对（PVE）的入口**占用空间太大**，收成一个小条 ——
   只有 图标 + 名字 + 一行状态（不再有简介段与三颗标签），也不占一整张卡的高度。
   用属性选择器而不是多加一个类：入口卡依旧是「class="g-hall"」，
   既有的静态检查（数 class="g-hall" 的个数 = 五个入口）与 .g-hall 选择器全都不受影响。
   属性选择器的特异性也够高，手机媒体查询里 .g-hall 的 min-height / flex-start 不会把它重新撑高。 */
.g-hall[data-hall-compact] {
  grid-column: 1 / -1;                 /* 横跨整行：像一条小条，不把两列网格撑歪 */
  min-height: 44px;                    /* 手指点按目标下限 */
  padding: .45rem .7rem;
  gap: .55rem;
  align-items: center;
  flex-wrap: nowrap;
}
.g-hall[data-hall-compact] .ic { font-size: 1.2rem; }
.g-hall[data-hall-compact] b { font-size: .95rem; font-family: var(--serif, Georgia, serif); flex: 0 0 auto; }
.g-hall[data-hall-compact] .st {
  flex: 1 1 auto; min-width: 0;
  color: #4b5158; font-size: .78rem; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g-hall[data-hall-compact] .go { font-size: .8rem; }

.g-sec { margin: 1.1rem 0 0; }
.g-sec h2 { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 .5rem; }
/* 大厅顶部那两个"独立大厅"入口（棋牌 / 解密）：2026-10-11 加，见 games.js renderLobby 的注释 */
.g-lobbies { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); margin: .2rem 0 .8rem; }
.g-lobby {
  display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem;
  background: #fff; border: 1px solid var(--eg-b-soft, #c8ccd1); border-radius: 8px;
  text-decoration: none; color: var(--text, #202122); transition: box-shadow .15s ease, transform .15s ease;
}
.g-lobby:hover { box-shadow: 0 5px 16px rgba(32, 33, 34, .10); transform: translateY(-2px); }
.g-lobby .ic { font-size: 1.5rem; line-height: 1; flex: 0 0 auto; }
.g-lobby .tx { display: flex; flex-direction: column; gap: .12rem; flex: 1 1 auto; min-width: 0; }
.g-lobby .tx b { font-size: .98rem; }
.g-lobby .tx span { color: var(--text-3, #72777d); font-size: .78rem; line-height: 1.55; }
.g-lobby .go { color: var(--link, #3366cc); font-size: .84rem; font-weight: 700; flex: 0 0 auto; }
@media (max-width: 520px) { .g-lobby .tx span { display: none; } }
/* 「网页小游戏」里的小标题：同一节里再分"精选（真人手写）"与"批量生成的开源合集"两组 */
.g-sec h3.g-sub {
  font-size: .88rem; font-weight: 700; color: #54595d; margin: 1rem 0 .35rem;
  padding-left: .5rem; border-left: 3px solid var(--link, #3366cc);
}

.g-rooms { border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; }
.g-room-row {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem;
  border-bottom: 1px solid var(--eg-b-faint, #eaecf0); font-size: .84rem; flex-wrap: wrap;
}
.g-room-row:last-child { border-bottom: 0; }
.g-room-row .code { font-family: var(--mono, ui-monospace, Consolas, monospace); font-weight: 700; letter-spacing: .08em; }
.g-room-row .m { color: var(--text-3); font-size: .76rem; }
.g-tag { display: inline-block; border: 1px solid var(--eg-b-soft, #c8ccd1); padding: 0 .35rem; font-size: .72rem; color: var(--text-2); }
.g-tag.on { background: #eaf3ff; border-color: #3366cc; color: #2a54a8; }
/* 卡兹那一格：标出"独立牌桌"，主按钮是链接（得跟 button 长得一样） */
.g-card-kards { border-left: 4px solid #b32424; }
.g-card-kards h3 .g-tag { margin-left: .35rem; }
.g-card .ops a.g-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.g-tag.wait { background: #fff8e6; border-color: #d9a400; color: #8a6a00; }
/* 人机：AI 徽标 + "正在思考…"（超管开的人机房，真人一眼能看出哪个座位是机器） */
.g-tag.ai { background: #f3e8ff; border-color: #7c3aed; color: #5b21b6; font-weight: 700; letter-spacing: .02em; }

/* ---------------------------------------------------------------- 观战（2026-10-05 加）
   三个大厅（小游戏 /games、卡兹 /kards、拼点 /clash）共用这几个类：
     · .g-tag.live  「观战中 N 人」的徽标（跟"进行中/等人/AI"并排显示）
     · .g-spectate  观战横幅：**一眼看清"我在看，不能动手"**，背景用青色系，
                    与普通蓝色提示（.g-note）、黄色警告（.g-note.warn）都区分得开。
   手机：横幅里的字比正文略小、行高放宽，块内换行不撑出横向滚动。 */
.g-tag.live { background: #e6f7f4; border-color: #14866d; color: #0f6b57; font-weight: 700; }
.g-spectate {
  border-left-color: #14866d; background: #e9f7f4; color: #14524a;
  font-size: .84rem; line-height: 1.85; margin: 0 0 .6rem;
}
.g-spectate b { color: #0f5b4c; }
/* 观战时的操作条只有"退出观战 / 回大厅"，手机上也照旧吸底、按钮 ≥44px */
#gActions .g-btn { min-height: 40px; }
@media (max-width: 480px) {
  .g-spectate { font-size: .8rem; padding: .45rem .55rem; }
  #gActions .g-btn { min-height: 44px; }
}

/* ---------------------------------------------------------------- 段位与积分榜 */
/* 座位行里的段位小标：段位名 + 分数（分数用等宽小字，别把昵称挤没了） */
.g-tag.tier { background: #fff7e8; border-color: #d9a400; color: #7a5c00; white-space: nowrap; }
.g-tag.tier .rt { font-weight: 700; margin-left: .28rem; font-family: var(--mono, monospace); }
/* 本局结算的 ±N 分 */
.g-tag.rd-up { background: #e9f8ef; border-color: #14866d; color: #0f6b57; font-weight: 700; }
.g-tag.rd-down { background: #fdecec; border-color: #b32424; color: #8f1c1c; font-weight: 700; }
.g-tag.rd0 { background: #f6f6f6; border-color: #c8ccd1; color: var(--text-3); }

.g-lobby-acts { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin: 0 0 .9rem; }
.g-lobby-acts .g-tip { line-height: 1.7; }
.g-lobby-acts .g-tip b { color: #7a5c00; }

/* ================================================================ 个人资料快速编辑
   用户要求（2026-10）：大厅上就能改昵称 / 简介 / 头像。
   数据与个人中心共用同一批接口（PUT /api/profile、POST /api/upload/avatar），
   这里只管长相：左边头像（≥44px 的点按区）、右边两行输入 + 保存。 */
.g-quick-box {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .8rem;
  border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; padding: .7rem .8rem;
}
.g-quick-av { display: flex; flex-direction: column; align-items: center; gap: .4rem; min-width: 0; text-align: center; }
.g-quick-img {
  width: 4.5rem; height: 4.5rem; border-radius: 50%; overflow: hidden; display: flex;
  align-items: center; justify-content: center; line-height: 0;
  background: var(--bg-subtle, #f8f9fa); border: 1px solid var(--eg-b-soft, #c8ccd1);
}
.g-quick-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-quick-av .g-btn { min-height: 44px; }
.g-quick-fields { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.g-quick-row { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.g-quick-row > span { flex: 0 0 3rem; font-size: .82rem; color: var(--text-2); }
.g-quick-row .g-input { flex: 1 1 auto; min-width: 0; min-height: 44px; }
.g-quick-acts { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 620px) {
  /* 手机：单列（头像在上、输入在下），输入行各占一整行 —— 360 宽也不挤 */
  .g-quick-box { grid-template-columns: minmax(0, 1fr); gap: .6rem; padding: .6rem; }
  .g-quick-av { flex-direction: row; justify-content: flex-start; gap: .6rem; text-align: left; }
  .g-quick-img { width: 3.4rem; height: 3.4rem; flex: 0 0 auto; }
  .g-quick-row { flex-wrap: wrap; }
  .g-quick-row > span { flex: 0 0 100%; }
  .g-quick-acts .g-btn { flex: 1 1 auto; }
}

/* ================================================================ 小游戏论坛
   帖子来自资料库的社区动态（posts），这里只是 #小游戏 这个话题的另一种排布。 */
.g-forum .g-lead b { color: #2a54a8; }
.g-post-box { border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; padding: .55rem .6rem; }
.g-post-ta {
  width: 100%; min-height: 5.5rem; box-sizing: border-box; resize: vertical;
  flex: 1 1 auto; line-height: 1.8;
}
.g-post-acts { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.g-post-acts .g-btn { min-height: 44px; }
.g-posts { border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; }
.g-post { padding: .6rem .65rem; border-bottom: 1px solid var(--eg-b-faint, #eaecf0); min-width: 0; }
.g-post:last-child { border-bottom: 0; }
.g-post-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .84rem; }
.g-post-head .nm { min-width: 0; overflow-wrap: anywhere; }
.g-post-head .m { color: var(--text-3); font-size: .74rem; font-family: var(--mono, monospace); }
.g-post-body {
  margin: .4rem 0 0; font-size: .88rem; line-height: 1.85;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.g-post-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin: .4rem 0 0; }
.g-post-ops { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 0; }
.g-post-ops .g-btn { min-height: 44px; }
/* 自动动态（房间分享 / 对局结束 / 卡兹改卡 / 沙盘改图）：左边一条竖线，一眼区分人工与自动 */
.g-post-auto { box-shadow: inset 3px 0 0 0 #14866d; background: #fbfffd; }
/* 房卡（UI.roomCard 画的）：与主站社区动态页**同一个函数**、同一份内联样式，
   这里只保证它在本页换行不溢出（长房间码 / 长游戏名也撑不破 360—430 宽） */
.g-post .fd-room { max-width: 100%; min-width: 0; }
.g-post .fd-room b, .g-post .fd-room span { overflow-wrap: anywhere; }
.g-post-more { display: flex; justify-content: center; padding: .6rem; border-top: 1px solid var(--eg-b-faint, #eaecf0); }
.g-post-more .g-btn { min-height: 44px; }
/* 论坛的筛选行（全部 / 自动动态 / 玩家发的 + 话题说明） */
.g-forum-tabs { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin: 0 0 .55rem; }
.g-forum-tabs .g-btn { min-height: 44px; }
.g-forum-tabs .g-tip { flex: 1 1 12rem; }

/* ---------------------------------------------------------------- 快速匹配的等待面板
   （服务端排队 + 轮询 2 秒；这里只管长相：一行状态 + 一行说明 + 两个按钮） */
.g-match {
  border: 1px solid var(--soft, #c8ccd1); border-left: 4px solid var(--red, #b01);
  background: #fff; padding: .85rem 1rem; margin-bottom: .9rem;
}
.g-match .dhead { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; }
.g-match-line { margin: .35rem 0 .2rem; font-size: .92rem; line-height: 1.6; color: var(--tx2, #54595d); }
.g-match .g-tip { margin: .1rem 0 .5rem; }
.g-match .acts { display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 760px) { .g-match .g-btn { min-height: 44px; } }

/* 注：排行榜只有一张总榜（2026-09-27 起的规则），分页/tabs 的样式与用法都已撤掉 */

.g-board { border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; }
.g-board-row {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .45rem .6rem; border-bottom: 1px solid var(--eg-b-faint, #eaecf0); font-size: .84rem;
}
.g-board-row:last-child { border-bottom: 0; }
/* 自己那一行高亮（跟座位行的"轮到我"同一个绿，语义一致） */
.g-board-row.me { background: #f1fbf7; box-shadow: inset 3px 0 0 0 #14866d; }
.g-board-row .rk {
  min-width: 2rem; text-align: right; font-family: var(--mono, monospace); color: var(--text-3); flex: 0 0 auto;
}
.g-board-row .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.g-board-row .m { color: var(--text-3); font-size: .76rem; }
/* 手机（≤760px）：名次+昵称一行、段位与战绩换行，绝不让这一行横向撑破 */
@media (max-width: 760px) {
  .g-board-row { gap: .35rem .45rem; }
  .g-board-row .nm { flex: 1 1 auto; }
  .g-board-row .m { flex: 1 1 100%; padding-left: 2.35rem; }
}
.g-player-row.bot .nm { font-style: italic; }
.g-player-row .mut.thinking { color: #5b21b6; }
.g-player-row .mut.thinking::after {
  content: ""; display: inline-block; width: .9em; text-align: left;
  animation: g-dots 1.2s steps(4, end) infinite;
}
@keyframes g-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .g-player-row .mut.thinking::after { animation: none; content: "…"; } }
.g-empty { color: var(--text-3); font-size: .84rem; padding: .7rem .6rem; }

.g-joinbox { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 0; }
.g-input {
  font-family: inherit; font-size: .9rem; padding: .5rem .6rem; min-height: 40px;
  border: 1px solid var(--eg-b-soft, #c8ccd1); background: #fff; color: var(--text); border-radius: 2px;
  min-width: 0; flex: 1 1 8rem;
}
.g-input.code { text-transform: uppercase; letter-spacing: .18em; font-family: var(--mono, monospace); }

/* ---------------------------------------------------------------- 历史战绩
   （2026-10：「小游戏 → 历史战绩」那一屏，DOM 由 games.js 的 renderHistory/histRowHtml 生成）
   一行 = 一局：结果色块（胜/负/平/中止）+ 玩法 + ±分 + 对手 + 段位（徽章 旧分→新分）+ 相对时间。
   手机（≤760）：除了"结果 + 玩法 + ±分"，其余每一项都换行（照抄排行榜 .g-board-row .m 的规矩），
   所以 390 宽既不会横向溢出，也不用手横向拖。所有可点元素（下拉、加载更多、回大厅）≥44px。 */
.g-hist-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .6rem 0 0; }
.g-hist-filter { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--text-2); }
.g-hist-filter .g-input { min-height: 44px; flex: 0 0 auto; min-width: 8.5rem; }
.g-hist-bar .g-tip { flex: 1 1 100%; margin-top: .2rem; }
#gHistList { margin-top: .6rem; }
.g-hist-res {
  flex: 0 0 auto; min-width: 2.2rem; text-align: center; font-weight: 700; font-size: .78rem;
  padding: .12rem .3rem; border: 1px solid var(--eg-b-soft, #c8ccd1); background: var(--bg-subtle, #f8f9fa); color: var(--text-2);
}
.g-hist-res.win { background: #e9f8ef; border-color: #14866d; color: #0f6b57; }
.g-hist-res.lose { background: #fdecec; border-color: #b32424; color: #8f1c1c; }
.g-hist-res.draw { background: #f6f6f6; border-color: #c8ccd1; color: var(--text-3); }
.g-hist-res.aborted { background: #fff8e6; border-color: #d9a400; color: #8a6a00; }
.g-hist-delta { font-family: var(--mono, monospace); font-weight: 700; font-size: .84rem; color: var(--text-2); flex: 0 0 auto; }
.g-hist-delta.up { color: #0f6b57; }
.g-hist-delta.down { color: #8f1c1c; }
.g-hist-delta.off { font-weight: 400; font-size: .76rem; color: var(--text-3); }
.g-hist-opp { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.g-hist-opp .g-tag { margin-left: .2rem; }
.g-hist-tier {
  display: inline-flex; align-items: center; gap: .18rem; flex-wrap: wrap; font-size: .76rem; color: var(--text-2);
  border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; padding: .1rem .35rem;
}
.g-hist-tier b { font-family: var(--mono, monospace); color: var(--text); }
.g-hist-row .arw { font-style: normal; color: var(--text-3); padding: 0 .1rem; }
.g-hist-row .g-hist-when { flex: 0 0 auto; }
.g-hist-more { display: flex; justify-content: center; margin: .7rem 0 0; }
.g-hist-more .g-note { width: 100%; text-align: center; border-left: 0; background: none; color: var(--text-3); }
@media (max-width: 760px) {
  /* 段位那一段（不是 .m）也跟着换行，并与上面的昵称左对齐（2.35rem 与排行榜同一口径） */
  .g-hist-row .g-hist-tier { flex: 1 1 100%; margin-left: 2.35rem; }
}

/* ---------------------------------------------------------------- 房间 */
.g-room-head {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  border: 1px solid var(--eg-b, #a2a9b1); background: var(--bg-alt, #f8f9fa);
  padding: .5rem .6rem; font-size: .84rem;
}
.g-room-head .code { font-family: var(--mono, monospace); font-weight: 700; letter-spacing: .1em; font-size: .95rem; }
/* ---------------------------------------------------------------- 大富翁 */
/* 棋盘下面那条：选中格详情 + 各家现金 + 当前能做的操作。
   手机上格子只有三十几像素，名字与租金全靠这一条看清。 */
.g-mono-info {
  border: 1px solid var(--eg-b-faint, #eaecf0); border-top: 0; background: #fff;
  padding: .45rem .6rem; display: flex; flex-direction: column; gap: .4rem; font-size: .8rem;
}
.g-mono-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; line-height: 1.7; min-height: 34px; }
.g-mono-cashes { gap: .5rem; }
.g-mono-cash {
  display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--eg-b-faint, #eaecf0);
  padding: .15rem .45rem; font-size: .78rem; color: var(--text-2); background: var(--bg-subtle, #f8f9fa);
}
.g-mono-cash i { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.g-mono-cash b { color: var(--text); }
.g-mono-cash.turn { border-color: #14866d; box-shadow: inset 0 -2px 0 0 #14866d; }
.g-mono-cash.out { opacity: .5; text-decoration: line-through; }
@media (max-width: 480px) {
  .g-mono-info { padding: .4rem .5rem; font-size: .76rem; }
  .g-mono-row { gap: .3rem; }
  .g-mono-info .g-btn { flex: 1 1 auto; min-height: 42px; }
}

/* 邀请链接：页面上直接能看到、能长按选中；手机上换行成"说明 + 输入框 + 按钮" */
.g-invite {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  border: 1px solid var(--eg-b-faint, #eaecf0); border-top: 0; background: #fff;
  padding: .4rem .6rem; font-size: .78rem;
}
.g-invite .g-tip { flex: 0 0 auto; }
.g-invite .g-input {
  flex: 1 1 12rem; min-height: 38px; font-size: .78rem; font-family: var(--mono, monospace);
  letter-spacing: 0; background: var(--bg-subtle, #f8f9fa);
}
@media (max-width: 480px) {
  .g-invite { padding: .4rem .5rem; }
  .g-invite .g-input { flex: 1 1 100%; order: 3; }
  .g-invite .g-btn { margin-left: auto; }
}
.g-room-body { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: .8rem; margin-top: .7rem; align-items: start; }
.g-play { min-width: 0; }
.g-side { min-width: 0; display: flex; flex-direction: column; gap: .7rem; }

.g-turn {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  border: 1px solid var(--eg-b-soft, #c8ccd1); border-left: 4px solid #3366cc;
  background: #f4f8ff; padding: .5rem .6rem; margin: 0 0 .6rem; font-size: .88rem; min-height: 44px;
}
.g-turn.mine { border-left-color: #14866d; background: #f1fbf7; font-weight: 700; }
.g-turn.over { border-left-color: #b32424; background: #fdf5f5; }
.g-turn .who { font-weight: 700; }
.g-turn .clock { margin-left: auto; font-family: var(--mono, monospace); font-size: .85rem; }
.g-turn .clock.warn { color: #b32424; }

.g-board-host { display: flex; justify-content: center; }
.g-board-host canvas { touch-action: manipulation; display: block; max-width: 100%; }
/* ---------------------------------------------------------------- UNO */
/* 牌面是**正式的 UNO 牌**：白底圆角牌 + 彩色内场 + 居中白椭圆（斜一点）+ 左上/右下角标，
   功能牌的图标用内联 SVG 画（不用 ⊘ ⇄ ★ 这类字形：各系统长得不一样，有的直接缺字形）。
   每张牌都带 --u-c（这张牌的颜色），所以文字/图标/描边都跟着牌色走。 */
.g-uno-wrap { display: flex; flex-direction: column; gap: .7rem; min-width: 0; max-width: 100%; }
.g-uno-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* 桌面区：牌堆 / 弃牌堆 / 当前颜色 / 方向 / 等谁出牌 */
.u-table {
  display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border: 1px solid var(--eg-b-faint, #eaecf0); background: linear-gradient(180deg, #fbfbfa, #f1f3f5);
  padding: .6rem .7rem;
}
.u-piles { display: flex; gap: 1rem; align-items: flex-end; }
.u-pilebox { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.u-piletip { font-size: .72rem; color: var(--text-3); }
.u-meta { display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; min-width: 9rem; }
.u-colorchip { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-2); }
.u-colorchip::before {
  content: ''; width: .72rem; height: .72rem; border-radius: 2px; background: var(--c, #72777d);
  border: 1px solid rgba(0,0,0,.22); flex: 0 0 auto;
}
.u-colorchip b { color: var(--c, var(--text)); }
.u-dir { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--text-3); }
.u-dir svg { width: 18px; height: 18px; color: #3366cc; flex: 0 0 auto; }
/* 顺时针/逆时针给不同的 class（箭头本身在 boards.js 里画成两个不同的弧） */
.u-dir-cw, .u-dir-ccw { display: inline-flex; align-items: center; }
.u-dir .u-dir-txt { color: var(--text); font-weight: 700; }

/* 顺序链：一眼看出"接下来轮到谁、按什么顺序走" —— 我 → 下一家 → 再下一家 ↩
   6 人局一行可能放不下，链**自己**横向滚动，页面不会被撑开。 */
.u-chain {
  display: flex; align-items: center; gap: .3rem; flex-wrap: nowrap; overflow-x: auto;
  max-width: 100%; min-width: 0; padding: .25rem .1rem .15rem; -webkit-overflow-scrolling: touch;
}
.u-chain-lead { font-size: .74rem; color: var(--text-3); flex: 0 0 auto; }
.u-chain-item {
  display: inline-flex; align-items: center; gap: .25rem; flex: 0 0 auto; white-space: nowrap;
  border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; color: var(--text-2);
  padding: .18rem .45rem; font-size: .78rem;
}
.u-chain-item.me { font-weight: 700; color: var(--text); border-color: #c8ccd1; }
.u-chain-item.turn { background: #f1fbf7; border-color: #14866d; color: #0f6b57; font-weight: 700; box-shadow: inset 0 -2px 0 0 #14866d; }
.u-chain-item.next { border-style: dashed; border-color: #3366cc; color: #2b5aa8; }
.u-chain-item.out { opacity: .45; text-decoration: line-through; }
.u-arrow { width: 16px; height: 16px; color: #72777d; flex: 0 0 auto; }
.u-arrow-back { color: #3366cc; }
.u-chain-badge { font-size: .68rem; color: var(--text-3); flex: 0 0 auto; }
.u-wait { font-size: .8rem; color: var(--text-2); border-left: 3px solid #c8ccd1; padding-left: .4rem; line-height: 1.6; }
.u-wait.mine { border-left-color: #14866d; color: #0f6b57; font-weight: 700; }

/* 一张牌。尺寸走变量：手牌区要按"一行几张、最多几行"算高度，
   所以宽高不能散落在各处（手机上换成 --u-w/--u-h，手牌区的 max-height 跟着变）。 */
.u-card {
  --u-w: 62px; --u-h: 92px;
  position: relative; width: var(--u-w); height: var(--u-h); border-radius: 9px; background: #fff; box-sizing: border-box;
  border: 1px solid rgba(0,0,0,.22); box-shadow: 0 1px 3px rgba(0,0,0,.22); overflow: hidden;
  padding: 0; --u-c: #37474f;
}
.u-field { position: absolute; inset: 4px; border-radius: 6px; background: var(--u-c); }
.u-oval {
  position: absolute; left: 50%; top: 50%; width: 88%; height: 60%; transform: translate(-50%, -50%) rotate(-20deg);
  background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.u-big {
  transform: rotate(20deg); display: inline-flex; align-items: center; justify-content: center; gap: .06rem;
  font-family: Georgia, "Songti SC", serif; font-weight: 800; font-size: 1.75rem; line-height: 1; color: var(--u-c);
}
.u-ico { width: 30px; height: 30px; color: var(--u-c); }
.u-plus { font-family: Georgia, serif; font-weight: 800; font-size: 1.4rem; color: var(--u-c); letter-spacing: -.02em; }
.u-corner {
  position: absolute; font-size: .72rem; font-weight: 800; color: #fff; line-height: 1;
  text-shadow: 0 1px 1px rgba(0,0,0,.45); display: flex; align-items: center;
}
.u-corner .u-ico { width: 13px; height: 13px; }
.u-corner.tl { left: 5px; top: 4px; }
.u-corner.br { right: 5px; bottom: 4px; transform: rotate(180deg); }
.u-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  background: conic-gradient(#d32f2f 0 25%, #e5a800 0 50%, #2e7d32 0 75%, #1565c0 0);
}
/* 万能牌中间的四色小风车（万能牌本身没有颜色，"任意色"就画成四色） */
.u-quad { position: relative; width: 26px; height: 26px; display: inline-block; }
.u-quad .q { position: absolute; width: 50%; height: 50%; }
.u-quad .q.r { left: 0; top: 0; background: #d32f2f; border-radius: 50% 0 0 0; }
.u-quad .q.y { right: 0; top: 0; background: #e5a800; border-radius: 0 50% 0 0; }
.u-quad .q.g { left: 0; bottom: 0; background: #2e7d32; border-radius: 0 0 0 50%; }
.u-quad .q.b { right: 0; bottom: 0; background: #1565c0; border-radius: 0 0 50% 0; }
/* 牌背（牌堆） */
.u-back { background: #20242b; display: flex; align-items: center; justify-content: center; }
.u-back-oval {
  transform: rotate(-20deg); background: #d32f2f; color: #fff; font-family: Georgia, serif; font-weight: 800;
  font-size: .78rem; letter-spacing: .06em; padding: .3rem .5rem; border-radius: 50%; border: 2px solid #fff;
}
.u-drawpile.can { cursor: pointer; box-shadow: 0 0 0 3px #14866d, 0 4px 8px rgba(0,0,0,.2); }
.u-drawpile.off { opacity: .75; }
.u-discard .u-card { width: 74px; height: 108px; }
.u-discard .u-big { font-size: 2rem; }

/* 牌的状态：能出 / 不能出 / 刚摸到 / 点错了抖一下 */
.u-card.play { box-shadow: 0 0 0 3px #14866d, 0 4px 8px rgba(0,0,0,.22); transform: translateY(-3px); }
.u-card.dim { opacity: .52; filter: saturate(.55); }
.u-card.just { box-shadow: 0 0 0 3px #d9a400, 0 4px 8px rgba(0,0,0,.22); }
.u-card.just::after {
  content: '新'; position: absolute; right: 3px; top: 3px; background: #d9a400; color: #20242b;
  font-size: .56rem; font-weight: 800; padding: 0 .18rem; border-radius: 2px;
}
@keyframes u-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.u-card.shake { animation: u-shake .28s ease-in-out; }

/* 手牌：**换行成多行，全部看得见**（不再靠横向滚动）。
   为什么改：牌一多（被 +2/+4、或者一直摸）横向滚动一屏只露 4—5 张，
   用户根本不知道自己手里有什么，能出的那张还常常在屏幕外。
   现在：一行放 6—7 张（390 宽、牌 52px），16 张 3 行以内**全部完整可见可点**；
   真的超过 3 行（极少见）就在**手牌区内部**纵向滚动，页面不会被撑开。
   这几个 min-width/max-width 仍然关键：不加手牌会把整页撑宽。 */
.u-hand {
  display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center;
  gap: .4rem; padding: .45rem .3rem .6rem; max-width: 100%; min-width: 0;
  overflow-x: hidden; overflow-y: auto;
  /* 3 行牌 + 间隙 + 上下内边距：这是"全显"的高度上限，超过它才在容器里滚 */
  max-height: calc(var(--u-h, 78px) * 3 + 1.6rem);
  -webkit-overflow-scrolling: touch;
}
.u-hand .u-card { flex: 0 0 auto; cursor: pointer; }
/* 旧类名也留着：别的检查（test-games-ui.js）按 .g-card-face 数牌，不能让它们红 */
.g-hand .g-card-face.play { box-shadow: 0 0 0 3px #14866d; }
.g-hand .g-card-face.dim { opacity: .55; }
.u-handwrap { display: flex; flex-direction: column; gap: .2rem; min-width: 0; max-width: 100%; }
.u-handhead { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.u-handhead .g-tag { margin-left: auto; }

/* 各家（含自己）：小牌堆 + 张数 + UNO 状态 + 抓人 */
.u-opps { display: flex; gap: .45rem; flex-wrap: wrap; max-width: 100%; }
.u-opp {
  display: flex; align-items: center; gap: .4rem; border: 1px solid var(--eg-b-faint, #eaecf0);
  background: #fff; padding: .35rem .5rem; font-size: .8rem; min-height: 46px;
}
.u-opp.me { background: #f7fbff; }
.u-opp.turn { box-shadow: inset 3px 0 0 0 #14866d; }
.u-stack { display: inline-flex; align-items: center; min-width: 18px; }
.u-mini { width: 15px; height: 22px; border-radius: 3px; background: #fff; border: 1px solid rgba(0,0,0,.3); display: inline-block; }
.u-mini.over { margin-left: -9px; }
.u-opp-nm { font-weight: 600; }
.u-opp-n { font-size: .74rem; color: var(--text-3); }
.u-catch { min-height: 40px; padding: .25rem .55rem; font-size: .78rem; }
.u-note { border-left: 4px solid #3366cc; background: #eaf3ff; padding: .45rem .6rem; font-size: .8rem; line-height: 1.8; }

/* 选颜色弹窗：颜色块要大（手指点得中），并带颜色名 */
.g-color-pick { display: flex; gap: .4rem; }
.g-color-pick button {
  width: 48px; height: 48px; border-radius: 10px; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: pointer;
}
@media (max-width: 480px) {
  .u-table { padding: .5rem; gap: .5rem; }
  /* 牌窄一点换行数：50×74（宽仍 ≥44，手指点得中）。
     间距也从 .35rem 收到 .2rem —— 实测 52px + .35rem 在 390 宽下**一行只放 5 张**，
     16 张就变 4 行、手牌区占到 312px。收到 50px + .2rem 后一行 6 张，16 张正好 3 行。 */
  .u-card { --u-w: 50px; --u-h: 74px; width: 50px; height: 74px; }
  .u-big { font-size: 1.35rem; }
  .u-ico { width: 24px; height: 24px; }
  .u-discard .u-card { --u-w: 62px; --u-h: 92px; width: 62px; height: 92px; }
  .u-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
  .u-wait { width: 100%; }
  /* 手牌：一行 4 张（房间布局在 390px 下只给手牌区约 210px 宽），**最多 4 行全显**。
     为什么是 4 行而不是 3 行：16 张（被罚抽后就常见）必然是 4 行，卡在 3 行会把第 4 行
     推进纵向滚动里 —— 那正是用户说的"牌多了根本看不全"。再多（20 张）才在容器内滚。 */
  .u-hand { gap: .2rem; max-height: calc(74px * 4 + 1.6rem); }
  .u-chain { padding-bottom: .35rem; }
  .u-opps { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; -webkit-overflow-scrolling: touch; }
  .u-opp { flex: 0 0 auto; }
  .u-acts { gap: .4rem; }
  .u-acts .g-btn { flex: 1 1 auto; min-height: 44px; }
  .u-acts .g-tip { flex: 1 1 100%; }
  .u-hand { padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px)); }
}

.g-players { border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; }
.g-player-row {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem;
  border-bottom: 1px solid var(--eg-b-faint, #eaecf0); font-size: .84rem;
}
.g-player-row:last-child { border-bottom: 0; }
.g-player-row.turn { background: #f1fbf7; box-shadow: inset 3px 0 0 0 #14866d; }
.g-player-row .dot { width: .6rem; height: .6rem; border-radius: 50%; background: #c8ccd1; flex: 0 0 auto; }
.g-player-row .dot.me { background: #3366cc; }
.g-player-row .nm { font-weight: 600; }
.g-player-row .mut { color: var(--text-3); font-size: .76rem; }

.g-log { border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; max-height: 12rem; overflow: auto; }
.g-log div { padding: .3rem .55rem; border-bottom: 1px solid var(--eg-b-faint, #eaecf0); font-size: .78rem; color: var(--text-2); }
.g-log div:last-child { border-bottom: 0; }

.g-chat { border: 1px solid var(--eg-b-faint, #eaecf0); background: #fff; display: flex; flex-direction: column; }
.g-chat-list { max-height: 12rem; overflow: auto; padding: .4rem .55rem; display: flex; flex-direction: column; gap: .3rem; }
.g-chat-list .who { color: var(--text-3); font-size: .74rem; }
.g-chat-list .txt { font-size: .84rem; line-height: 1.7; word-break: break-word; }
.g-chat-form { display: flex; gap: .4rem; padding: .45rem; border-top: 1px solid var(--eg-b-faint, #eaecf0); }
.g-chat-form .g-input { min-height: 40px; }

.g-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.g-note { border-left: 4px solid #3366cc; background: #eaf3ff; padding: .5rem .6rem; font-size: .82rem; line-height: 1.8; }
.g-note.warn { border-left-color: #d9a400; background: #fff8e6; }
.g-tip { color: var(--text-3); font-size: .76rem; line-height: 1.8; }

/* 弹窗（新建房间 / 规则说明）：沿用 UI.dialog 的 w-dialog，这里只补内部排版 */
.g-form-row { display: flex; flex-direction: column; gap: .3rem; margin: 0 0 .7rem; }
.g-form-row > label { font-size: .82rem; color: var(--text-2); }
.g-form-row .row { display: flex; gap: .5rem; flex-wrap: wrap; }
.g-help { font-size: .82rem; line-height: 1.9; color: var(--text-2); white-space: pre-wrap; }

/* ---------------------------------------------------------------- 手机 */
@media (max-width: 900px) {
  /* 手机/窄屏：单列，棋盘优先，聊天与记录往后排 —— 竖屏时手指够得着 */
  .g-room-body { grid-template-columns: minmax(0, 1fr); }
  .g-side { order: 2; }
  .g-play { order: 1; }
  .g-title { font-size: 1.25rem; }
  .g-cards { grid-template-columns: minmax(0, 1fr); }
  .g-log { max-height: 9rem; }
  .g-chat-list { max-height: 9rem; }
}
@media (max-width: 480px) {
  .st-main { padding: 0 .6rem .9rem; }
  .g-room-head { font-size: .8rem; }
  .g-actions .g-btn { flex: 1 1 auto; }
  .g-turn { font-size: .84rem; }
  /* 拇指区：底部操作条贴住屏幕下沿，滚动时也够得着（避开 iPhone 安全区） */
  .g-sticky {
    position: sticky; bottom: 0; z-index: 8; margin-top: .3rem;
    background: linear-gradient(to top, var(--bg-page, #f6f6f6) 72%, rgba(246,246,246,0));
    padding: .45rem 0 calc(.45rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ===== 斗地主（Dou Dizhu）===== */
.d-wrap { display: flex; flex-direction: column; gap: .55rem; min-width: 0; }
.d-opps { display: flex; gap: .4rem; flex-wrap: wrap; }
.d-opp { display: flex; align-items: center; gap: .35rem; border: 1px solid var(--eg-b-faint, #eaecf0);
  background: #fff; padding: .3rem .5rem; border-radius: 2px; font-size: .8rem; }
.d-opp.turn { border-color: #14866d; box-shadow: inset 0 0 0 1px #14866d; }
.d-opp.me .nm { font-weight: 700; }
.d-opp .mut { color: var(--eg-fg-2, #54595d); }
.d-badge { background: #b01; color: #fff; font-size: .68rem; padding: .05rem .3rem; border-radius: 2px; }
.d-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.d-bottom, .d-last { display: flex; gap: .25rem; flex-wrap: wrap; }

.d-handwrap { min-width: 0; max-width: 100%; }
.d-hand { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; padding: .3rem 0 .5rem; }
.d-card { position: relative; flex: 0 0 auto; width: 52px; height: 76px; background: #fff;
  border: 1px solid #c8ccd1; border-radius: 4px; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.12); transition: transform .12s, box-shadow .12s; }
.d-card .d-corner { position: absolute; font-size: .58rem; line-height: 1; font-weight: 700; }
.d-card .d-corner.tl { top: 3px; left: 3px; }
.d-card .d-corner.br { bottom: 3px; right: 3px; transform: rotate(180deg); }
.d-card .d-big { font-size: .95rem; font-weight: 700; letter-spacing: .02em; }
.d-card.d-red { color: #c62828; }
.d-card.d-black { color: #212121; }
.d-card.small { width: 34px; height: 50px; cursor: default; }
.d-card.small .d-corner { display: none; }
.d-card.small .d-big { font-size: .72rem; }
.d-card.can { box-shadow: 0 0 0 2px #14866d, 0 2px 6px rgba(0,0,0,.18); }
.d-card.sel { transform: translateY(-10px); box-shadow: 0 0 0 3px #b01, 0 6px 12px rgba(0,0,0,.22); }
.d-acts { display: flex; gap: .4rem; flex-wrap: wrap; padding-bottom: env(safe-area-inset-bottom, 0); }

@media (max-width: 480px) {
  .d-card { width: 46px; height: 68px; }          /* 仍 ≥44×44 的可点区 */
  .d-card .d-big { font-size: .82rem; }
  .d-hand { gap: .25rem; }
  .d-acts .g-btn { min-height: 44px; flex: 1 1 auto; }
  .d-card.sel { transform: translateY(-8px); }
}

/* ===== 手机兜底：小游戏大厅那一整块的可点区域 ≥44px =====
   新大厅（导航栏 / 玩法徽章 / 资料快速编辑 / 论坛）按 2026-10 的要求全部 ≥44px；
   卡片里的按钮原来只有 40px，也一起抬到 44。放在文件最后：同优先级时这条生效，
   不会被前面那些 40/42px 的规则压回去（tools/test-games-lobby.js ⑧ 会量 360/390/430）。 */
@media (max-width: 480px) {
  .g-wrap .g-btn, .g-nav .g-btn, .g-post-box .g-btn, .g-posts .g-btn { min-height: 44px; }
  .g-chip { min-height: 44px; }
}

/* ===== 开局转盘弹窗（2026-10-12 加）=====
   ★ 2026-10-12 返工：转盘的样式**搬到 assets/games/spin.js 里了**（第一次用时自己往
   <head> 注入一段 <style>，id = nzSpinCss）—— 因为卡兹 / 拼点 / 沙盘三个独立大厅页
   也要画这个弹窗，而它们各改各的 CSS，不该为了一个弹窗互相牵连（与 settle.js 同一个做法）。
   这里不再留副本：同一个类名两处定义，日后改文案/尺寸必然只改一处、另一处悄悄变成"活的"。
   要改转盘的样子，改 assets/games/spin.js 的 ensureCss()。 */

/* ===== 小游戏赛季：大厅顶部那条置顶进度条 + 公告弹窗（2026-10-21）=====
   用户要求「在小游戏大厅置顶进度条（什么时候赛季结束）」。几条硬规矩：
     · **置顶**：position: sticky; top: 0 —— 大厅里滚动时它一直贴着顶
       （.st-main 才是滚动容器，顶栏 .st-bar 在它外面，两者不会互相盖住）；
     · **没有生效赛季时整条不出现**（games.js 直接回空字符串），不留空占位；
     · 手机上 390px **不横向溢出**：整条 flex-wrap 换行，赛季名与倒计时都能折行，
       超长赛季名靠 overflow-wrap: anywhere 兜住；
     · 「赛季说明」按钮 ≥44px —— 它在 .g-wrap **外面**，吃不到文件末尾那条
       `.g-wrap .g-btn { min-height: 44px }` 的兜底规则，所以这里单独写死。 */
.g-season {
  position: sticky; top: 0; z-index: 25;
  border: 1px solid var(--eg-b, #a2a9b1); border-left: 4px solid #b26a00;
  background: #fffdf4; padding: .4rem .6rem .5rem; margin: 0 0 .7rem;
}
.g-season-top { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; min-width: 0; }
.g-season-tag {
  flex: 0 0 auto; font-size: .72rem; line-height: 1.6; color: #fff; background: #b26a00;
  padding: 0 .35rem; border-radius: 2px;
}
.g-season-name {
  font-family: var(--serif); font-size: .98rem; min-width: 0;
  overflow-wrap: anywhere; word-break: break-word;
}
.g-season-left { font-size: .8rem; color: #7a5200; margin-left: auto; }
.g-season .g-btn { min-height: 44px; padding: 0 .7rem; font-size: .84rem; }
.g-season-bar { height: 10px; margin-top: .4rem; background: #f1e7d3; border: 1px solid #e2d5ba; overflow: hidden; }
.g-season-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #e8b04a, #b26a00); }
/* 还没开始 / 已结束：灰一点，一眼看出"不是进行中" */
.g-season[data-season-state="pending"] .g-season-fill { background: #c9c2b4; }
.g-season[data-season-state="ended"] .g-season-fill { background: #8d8577; }
.g-season[data-season-state="ended"] .g-season-tag { background: #8d8577; }
/* 公告弹窗与「赛季说明」里那两段文字 */
.g-season-intro { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: .45rem; }
.g-season-when { font-size: .84rem; color: var(--text-2, #54595d); }
@media (max-width: 480px) {
  /* 360 / 390 宽：倒计时自己占一行，别把赛季名挤成一条竖线 */
  .g-season-left { flex: 1 1 100%; margin-left: 0; }
  .g-season-name { font-size: .92rem; }
  .g-season .g-btn { width: 100%; justify-content: center; }
}

