/* 游戏大厅样式：手机竖屏优先、明亮柔和、点击区域够大 */
:root {
  --bg: #FFF7F0;
  --card: #FFFFFF;
  --text: #3A2E28;
  --text-sub: #8E7B70;
  --text-faint: #B3A297;
  --main: #FF8A5B;
  --main-soft: #FFE7D9;
  --chip-bg: #FFF1E6;
  --r-lg: 20px;
  --r-md: 14px;
  --shadow: 0 4px 14px rgba(120, 80, 50, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 确保 hidden 属性始终生效（防止 .modal-mask 的 display:flex 覆盖） */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.hall {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

/* ===== 页头（标题在左，账号入口在右上角） ===== */
.hall-head {
  padding: 2px 4px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.hall-head-text { flex: 1; min-width: 0; }
.hall-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
}
/* 统一吉祥物「小玩伴」：跟在标题文字后面 */
.hall-title .mascot-badge { display: inline-block; vertical-align: -7px; margin-left: 6px; }
.hall-title .mascot-svg { display: block; }
.hall-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-sub);
}

/* 右上角账号按钮：未登录是浅浅的胶囊，登录后显示昵称 */
.acc-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 42vw;
  min-height: 44px;
  padding: 0 12px;
  margin-top: 2px;
  border: 1.5px solid #E8DCCC;
  border-radius: 999px;
  background: #fff;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.acc-chip:active { opacity: .75; }
/* ⚠️ .acc-chip 自己设了 display:inline-flex，会盖掉 [hidden] 的 display:none ——
   「管理」入口靠 hidden 控制显隐，必须显式补这一条，否则对所有人可见。 */
.acc-chip[hidden] { display: none; }
.acc-chip.is-in {
  border-color: var(--main-soft);
  background: var(--main-soft);
  color: var(--main);
}
.acc-chip-ico { font-size: 14px; line-height: 1; }
.acc-chip-tx {
  max-width: 26vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 分区标题（带小竖线，层次更清楚） ===== */
.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}
.sec-title::before {
  content: '';
  flex: 0 0 auto;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--main);
  opacity: .75;
}
.sec-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
}

/* ===== 可折叠小节标题（最近玩过 / 今日推荐，2026-10-14）=====
   手机首屏别堆太多：最近玩过默认收起成一行、今日推荐默认展开但一有操作就折起。 */
.sec-fold {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin: 10px 0 4px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  text-align: left;
}
.sec-fold::before {
  content: '';
  flex: 0 0 auto;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--main);
  opacity: .75;
}
.sec-fold-tx { flex: 0 0 auto; }
.sec-fold-hint {
  flex: 1;
  min-width: 0;
  font-weight: 400;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sec-fold-caret { flex: 0 0 auto; color: var(--text-faint); font-size: 12px; }

/* ===== 接着玩 ===== */
.recent-row {
  display: flex;
  gap: 10px;
  padding: 2px 4px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.recent-card {
  flex: 0 0 auto;
  width: 96px;
  padding: 12px 8px;
  background: var(--soft, #FFF3EA);
  border: none;
  border-radius: var(--r-md);
  text-align: center;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}
.recent-card:active { transform: scale(.97); }
.recent-emoji { font-size: 25px; line-height: 1.2; }
.recent-name {
  margin-top: 5px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 今日推荐（2026-10-14）：开机给 3 个建议，终结"55 个不知选哪个" ===== */
.today { padding: 0 4px 10px; }
/* 「就我一个 / 一起玩」两态（2026-10-16）：紧贴今日推荐，比筛选 chip 矮一点、不抢注意力 */
.who-row { display: flex; gap: 6px; padding: 2px 0 8px; }
.who-btn {
  flex: 1;
  min-height: 38px;
  padding: 0 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-sub);
  background: var(--chip-bg);
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.who-btn.is-on { background: var(--card); border-color: var(--main); color: var(--text); font-weight: 700; }
/* 睡前时段提示（2026-10-16）：20:00 后出现，安静收尾的 3~4 个入口 */
.night-tip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 9px;
  padding: 9px 11px; background: #F2F4FA; border-radius: var(--r-md); }
.night-lab { flex: 0 0 100%; font-size: 12.5px; color: #5C6488; }
.night-chip { font-size: 13px; color: #3E4670; background: var(--card); border-radius: 999px;
  padding: 6px 11px; text-decoration: none; border: 1px solid #E1E5F2; }
.today-row[hidden] { display: none; }
.recent-row[hidden] { display: none; }
.today-row { display: flex; flex-direction: column; gap: 8px; }
.today-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 14px;
  background: var(--card);
  border: 1.5px solid var(--soft-line, #F0E6DA);
  border-left: 4px solid var(--c, var(--main));
  border-radius: var(--r-md);
  text-align: left;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(120, 80, 50, .05);
}
.today-card:active { transform: scale(.985); }
.today-ico {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: var(--soft, #FFF3EA);
  border-radius: 12px;
}
.today-tx { flex: 1; min-width: 0; }
.today-name { font-size: 15.5px; font-weight: 700; }
.today-desc {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.today-go {
  flex: 0 0 auto;
  font-size: 13px; font-weight: 700;
  color: var(--c, var(--main));
  white-space: nowrap;
}

/* ===== 搜索 ===== */
.search-row { position: relative; padding: 0 4px; }
.search-row::before {
  content: '🔍';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: .5;
  pointer-events: none;
}
.search {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  font-size: 16px; /* 16px 以上避免 iOS 聚焦缩放 */
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  outline: none;
  -webkit-appearance: none;
}
.search:focus { border-color: var(--main-soft); }
.search::placeholder { color: var(--text-faint); }

/* 输入 6 位房间码时冒出来的「直接加入」—— 是一整条可点的横幅，不是卡片 */
.join-room {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 8px);
  margin: 8px 4px 0;
  padding: 12px 14px;
  background: var(--main);
  border: none;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  font-family: inherit;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.join-room[hidden] { display: none; }
.join-room:active { transform: scale(.985); }
.join-room-ico { font-size: 22px; line-height: 1; }
.join-room-txt { flex: 1; min-width: 0; }
.join-room-main { display: block; font-size: 15px; font-weight: 600; }
.join-room-sub { display: block; margin-top: 2px; font-size: 12px; opacity: .85; }
.join-room-go { flex: 0 0 auto; font-size: 13px; font-weight: 600; }

/* ===== 分类筛选：chip 风格，选中态更明确；向下滚动时吸顶 ===== */
.tag-row {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 10px 4px;
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;            /* 隐藏横滚条：用右侧渐隐代替它提示还能滑 */
  -ms-overflow-style: none;
}
.tag-row::-webkit-scrollbar { display: none; }
/* 只在真的还能往右滑时才渐隐，滑到底自动收起来（由 hall.js 加 class） */
.tag-row.can-scroll {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), rgba(0, 0, 0, 0));
  mask-image: linear-gradient(to right, #000 calc(100% - 22px), rgba(0, 0, 0, 0));
}
.tag-row.stuck { box-shadow: 0 6px 14px rgba(120, 80, 50, .10); }
/* 学科行是第二行，不吸顶（否则和形态行叠一起） */
#subject-row { position: static; padding-top: 2px; padding-bottom: 10px; }
#subject-row.stuck { box-shadow: none; }
.tag-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 15px;
  font-size: 14px;
  font-family: inherit;
  color: #A1785C;
  background: var(--chip-bg);
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.tag-btn.active {
  color: #fff;
  background: var(--main);
  box-shadow: 0 4px 12px rgba(255, 138, 91, .32);
}
.tag-btn:active { transform: scale(.96); }

/* ===== 年龄分档：第二行筛选，视觉比分类轻一档 ===== */
.age-row {
  display: flex;
  gap: 8px;
  padding: 2px 4px 8px;
}
.age-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 13px;
  font-size: 12.5px;
  font-family: inherit;
  color: #A89084;
  background: transparent;
  border: 1.5px solid #E8DCCC;
  border-radius: 999px;
  cursor: pointer;
}
.age-btn.active {
  color: var(--main);
  border-color: var(--main);
  background: var(--chip-bg);
  font-weight: 600;
}

/* ===== 二级筛选折叠（学科 + 年龄默认收起） ===== */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  padding: 8px 4px;
  font-size: 13px;
  font-family: inherit;
  color: #A1785C;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.filter-toggle .filter-hint { color: var(--main); font-weight: 600; }
.filter-toggle .filter-caret { transition: transform .2s; }
.filter-toggle[aria-expanded="true"] .filter-caret { transform: rotate(180deg); }
.filter-panel {
  padding-bottom: 6px;
}
.filter-panel[hidden] { display: none; }
.filter-panel .tag-row,
.filter-panel .age-row { position: static; padding-top: 0; }

/* ===== 游戏卡片：三列图标式（应用网格风格），等高 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 4px;
}
.card {
  display: flex;
  flex-direction: column;
  min-height: 152px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: center;
  font-family: inherit;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.card:active { transform: scale(.98); }
.card-icon {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  background: linear-gradient(155deg, var(--soft2, #FFE7D9), var(--soft, #FFF3EA));
}
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 6px 0;
}
.card-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.card-due {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #D97706;
}

/* ===== 打卡 / 成就条（P2#34） ===== */
/* ===== 状态条：谁在玩 + 积分 + 打卡，合成一条紧凑胶囊 =====
   手机上竖排太占地方，三个小条并成一行；每个是独立可点的 chip。 */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 2px 0 10px;
  /* 三个 chip（积分 / 宠物 / 打卡）在 320px 窄屏放不下 ⇒ 允许横向滚动，
     别把整页顶宽（曾辉「小屏不横溢」是硬要求）。 */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.status-bar::-webkit-scrollbar { display: none; }
.status-bar[hidden] { display: none; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1.5px solid #E5E0D6;
  border-radius: 999px;
  background: var(--chip-bg);
  color: #555;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.status-chip:active { background: var(--main-soft); }
.status-chip[hidden] { display: none; }
/* 谁在玩 chip：蓝色调 */
#child-bar { border-color: #D6E8FF; background: #F2F8FF; color: #2E6BB0; }
.child-bar-ico { font-size: 15px; }
/* 积分 chip：金色调 */
#points-bar { border-color: #FFE0A8; background: #FFF7E6; color: #B47600; }
.points-ico { font-size: 15px; }
.points-num { font-size: 15px; }
.points-go { font-size: 11px; opacity: .72; margin-left: 1px; white-space: nowrap; }
/* 打卡 chip：橙色调 */
#streak-bar { border-color: #FFE1C9; background: #FFF4EC; color: #B05A24; }
/* 宠物 chip：绿色调（点开进宠物乐园） */
#pet-bar { border-color: #CDEBD5; background: #F1FBF4; color: #2E7D5B; }
.pet-ico { font-size: 15px; }
#pet-bar .pet-badge { display: inline-flex; vertical-align: middle; }
#pet-bar .pet-badge svg { display: block; }

/* ===== 孩子切换抽屉（点开谁在玩） ===== */
.child-pick {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 210;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 12px;
  max-height: 60vh;
  overflow: auto;
}
.child-pick-title { font-size: 14px; font-weight: 700; color: #333; margin: 2px 4px 10px; }
.child-pick-hint { font-size: 13px; line-height: 1.5; color: #777; margin: 0 4px 10px; }
.child-pick button {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 4px 0;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: #F5F7FA;
  color: #333;
  font-size: 15px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.child-pick button.on { background: var(--main-soft); color: var(--main-deep); font-weight: 700; }
.child-pick button.child-new { background: transparent; color: #2E6BB0; font-weight: 600; }
.child-pick-mask {
  position: fixed;
  inset: 0;
  z-index: 209;
  background: rgba(0,0,0,.28);
}

/* ===== 成就墙弹层 ===== */
.badge-mask {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(58, 46, 40, .5);
}
.badge-card {
  width: 100%;
  max-width: 400px;
  max-height: 78vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px 18px 16px;
}
.badge-title { margin: 0; font-size: 20px; text-align: center; }
.badge-sub { margin: 4px 0 14px; font-size: 12px; color: var(--text-sub); text-align: center; }
.badge-list { display: flex; flex-direction: column; gap: 8px; }
.badge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg, #FFF7F0);
  opacity: .55;
}
.badge-item.on { opacity: 1; background: var(--chip-bg); }
.badge-item.can-claim { background: linear-gradient(90deg, #FFF6E5, #FFEFD6); box-shadow: inset 0 0 0 1.5px #F2C97D; }
.badge-ico { font-size: 22px; flex: none; }
.badge-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.badge-name { font-size: 14px; }
.badge-pts { font-size: 12px; font-weight: 700; color: #B47600; margin-left: 4px; }
.badge-desc { font-size: 12px; color: var(--text-sub); }
.badge-claim {
  flex: none; min-height: 32px; padding: 0 14px; border: none; border-radius: 999px;
  background: var(--main, #FF8A5B); color: #fff; font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer;
}
.badge-claim:active { transform: scale(.95); }
.badge-claim:disabled { opacity: .5; }
.badge-done { flex: none; font-size: 12px; color: #2E8B57; font-weight: 700; }
/* 有可认领成就时，打卡条轻微高亮提示 */
#streak-bar.has-claim { box-shadow: 0 0 0 2px #F2C97D; }
.badge-close {
  display: block;
  margin: 14px auto 0;
  min-height: 44px;
  padding: 0 40px;
  border: none;
  border-radius: 999px;
  background: var(--main);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.badge-report {
  display: block;
  margin-top: 12px;
  min-height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--main);
  text-decoration: none;
}
.card-tags {
  margin-top: auto;
  padding: 6px 0 10px;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;   /* 只放一个 chip，保证所有卡片等高 */
  overflow: hidden;
  gap: 6px;
}
.chip {
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--c, #8A6A55);
  background: var(--soft, #FFF3EA);
  border-radius: 999px;
}
.chip-quiet {
  color: #A89084;
  background: #F6EFE9;
  font-weight: 400;
}
/* 玩的方式 + 时长（2026-10-16）：年龄徽章下面一行，小一号、不抢视线 */
.card-ways {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 0 9px;
}
.card-ways .chip { font-size: 11px; padding: 2px 8px; }
.chip-way { color: #6B7F6E; background: #EAF2EC; }
/* 本机用过的号码牌（2026-10-16）：登录页的一键填入 */
.acc-codes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 10px; text-align: left; }
.acc-codes-lab { flex: 0 0 100%; font-size: 12px; color: var(--text-faint); }
.acc-code-chip {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  letter-spacing: 1px;
  color: var(--text);
  background: var(--chip-bg);
  border: 1.5px solid #E8DCD2;
  border-radius: 999px;
  cursor: pointer;
}
.acc-code-chip:active { border-color: var(--main); background: var(--main-soft); }
/* 年龄分档徽章：幼/小/成 单字圆片 */
.chip-age {
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 50%;
}
/* 免费角标（free 类游戏：既不赚也不扣积分，如幼儿涂色） */
.chip-free {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: #E8F7EE;
  color: #2E9E5B;
}

/* ===== 空态 / 页脚 ===== */
.empty {
  margin: 30px 8px;
  text-align: center;
  font-size: 15px;
  color: var(--text-sub);
}
.hall-foot {
  margin-top: 24px;
  padding: 0 8px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
}
.hall-foot p { margin: 0; }
.hall-copy {
  margin-top: 6px !important;
  font-size: 11px;
  letter-spacing: .2px;
  opacity: .72;
}
.hall-src { margin-top: 4px !important; }
.hall-src a {
  color: var(--main);
  text-decoration: none;
}
.hall-src a:active { opacity: .7; }
.hall-mail { margin-top: 8px !important; }
.hall-mail a {
  color: var(--main);
  text-decoration: none;
  font-size: 12.5px;
}
.hall-mail a:active { opacity: .7; }

/* 小屏（iPhone SE 一类）稍微收紧 */
@media (max-width: 360px) {
  .hall { padding-left: 12px; padding-right: 12px; }
  .grid { gap: 8px; }
  .card { min-height: 144px; }
  .card-icon { height: 60px; font-size: 30px; }
  .card-name { font-size: 13px; }
}

/* 平板 / 桌面（容器最宽 640px）：游戏多了以后 4 列更合适 */
@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .card { min-height: 158px; }
  .card-icon { height: 72px; font-size: 36px; }
}

/* 电脑 / 投影（≥768px）：整站放宽、更多列、字更大 —— 「手机一版、电脑一版」自动切换。
   2026-10-14 曾辉：手机和电脑屏幕（集体/投影）要自动两个版本。必须排在上面 520 那条之后。 */
@media (min-width: 768px) {
  .hall { max-width: 940px; padding-left: 26px; padding-right: 26px; }
  .hall-title { font-size: 26px; }
  .hall-sub { font-size: 14px; }
  .grid { grid-template-columns: repeat(6, 1fr); gap: 14px; }
  .card { min-height: 172px; }
  .card-icon { height: 80px; font-size: 40px; }
  .card-name { font-size: 15px; }
  .sec-fold { font-size: 14px; min-height: 44px; }
}

/* ===== 未授权提示条（清单照常展示，只开放 1 个试玩） ===== */
.trial-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 12px;
  padding: 8px 10px 8px 12px;
  background: var(--main-soft);
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.4;
  color: #A1785C;
}
.trial-text { flex: 1; min-width: 0; }
.trial-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--main);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.trial-btn:active { opacity: .85; }

/* ===== 卡片角标：🔒 需通行码（只出现在联机游戏上） ===== */
.card-lock {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
}

/* ===== 卡片收藏星标（存本机，免登录） ===== */
.card-icon { position: relative; }
.fav-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  color: #C9B8A8;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.fav-btn.on { color: #FFB300; }
.fav-btn:active { transform: scale(.92); }

/* ===== 页脚：设备授权状态 ===== */
.hall-access { margin-top: 8px !important; font-size: 11px; color: var(--text-faint); }
.link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--main);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:active { opacity: .7; }

/* ===== 通行码弹窗（点需要通行码的游戏时弹出，压在清单之上） ===== */
.gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(58, 46, 40, .45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.gate-card {
  position: relative;
  width: 100%;
  max-width: 330px;
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .20);
}
.gate-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-faint);
  font-size: 24px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
}
.gate-close:active { background: rgba(0, 0, 0, .05); }
.gate-emoji { font-size: 40px; line-height: 1; }
.gate-title { margin: 10px 0 6px; font-size: 20px; font-weight: 700; color: var(--text); }
.gate-note { margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--text-sub); }
.gate-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  border: 2px solid #E8DCCC;
  border-radius: 12px;
  outline: none;
  text-align: center;
}
.gate-input:focus { border-color: var(--main); }
.gate-err { margin: 8px 0 0; font-size: 13px; color: #F08A8A; }
.gate-btn {
  margin-top: 16px;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 14px;
  background: var(--main);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.gate-btn:active { opacity: .85; }
.gate-btn:disabled { opacity: .6; }
.gate-mail { margin: 16px 0 0; font-size: 12px; color: var(--text-faint); }
.gate-mail a { color: var(--main); text-decoration: none; }

/* ===== 页脚那行「登录 / 已登录」 ===== */
/* 登录方式切换（验证码 / 密码）：整块等宽，别做成会挤的小标签 */
.acc-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  border-radius: 12px;
  background: var(--main-soft);
}
.acc-tab {
  flex: 1;
  min-height: 40px;
  border: none;
  border-radius: 9px;
  background: none;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.acc-tab.is-on { background: #fff; color: var(--main); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.acc-tip { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-faint); }

/* ===== 登录弹窗（可选登录；样式与通行码弹窗同源） ===== */
.acc {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(58, 46, 40, .45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.acc-card {
  position: relative;
  width: 100%;
  max-width: 330px;
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .20);
}
.acc-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-faint);
  font-size: 24px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
}
.acc-close:active { background: rgba(0, 0, 0, .05); }
.acc-emoji { font-size: 40px; line-height: 1; }
.acc-title { margin: 10px 0 6px; font-size: 20px; font-weight: 700; color: var(--text); }
.acc-note { margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--text-sub); }
/* 紧跟输入框上方的说明（比普通 note 收一点，别把表单顶下去）：家庭码注册那一步用 */
.acc-note-top { margin: 0 0 12px; }
.acc-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  margin-bottom: 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  border: 2px solid #E8DCCC;
  border-radius: 12px;
  outline: none;
}
.acc-input:focus { border-color: var(--main); }
.acc-row { display: flex; gap: 8px; align-items: flex-start; }
.acc-row .acc-input-code { flex: 1; min-width: 0; }
/* ⚠️ 行内按钮必须收回 width:100%，否则把同行的输入框挤成一条缝（2026-10-11 曾辉截图实测） */
.acc-row .acc-btn { width: auto; flex: 0 0 auto; margin-top: 0; }
.acc-row .acc-input { flex: 1 1 auto; min-width: 0; width: auto; }
.acc-send {
  flex: none;
  height: 48px;
  padding: 0 12px;
  border: 2px solid var(--main);
  border-radius: 12px;
  background: #fff;
  color: var(--main);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.acc-send:active { opacity: .85; }
.acc-send:disabled { opacity: .5; }
.acc-err { margin: 2px 0 0; font-size: 13px; color: #F08A8A; text-align: left; }
.acc-btn {
  margin-top: 16px;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 14px;
  background: var(--main);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.acc-btn:active { opacity: .85; }
.acc-btn:disabled { opacity: .6; }
.acc-btn-ghost { background: #fff; color: var(--main); border: 2px solid var(--main); }
/* 账号面板里几个动作之间的关系：「退出登录」是破坏性的但不必喊，做成一行安静的文字 */
.acc-btn-quiet {
  margin-top: 8px;
  min-height: 44px;
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 14px;
  font-weight: 500;
}
.acc-or { margin: 16px 0 0; font-size: 12px; color: var(--text-faint); }
/* 账号面板「待处理请求」的红点徽标 */
.acc-badge {
  display: inline-block;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 10px;
  background: #e5484d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}
/* 「我的账号 ID」这行：等宽字体 + 可整体选中复制 */
#acc-my-uid { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; width: auto; }
#acc-copy-uid { min-height: 44px; }

/* ===== 回大厅按钮（历史页 / 管理页这类从大厅出去的页面用；大厅自己不用） =====
 * 和大厅顶栏的 chip 同高，视觉上是一家人。 */
.btn-hall {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 10px;
  z-index: 60;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
  color: var(--text-sub);
  background: rgba(255, 255, 255, .55);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(120, 80, 50, .14);
  text-decoration: none;
}
.btn-hall:active { transform: scale(.92); }
.btn-back { margin-left: 0; }

/* ===== 我的对局记录（history.html） ===== */
.hist { padding-top: 64px; }
.hist .hall-head { padding-left: 0; }
.hist-list { display: block; }
.hist-day { margin: 0 0 18px; }
.hist-day-label {
  margin: 0 0 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}
.hist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 0 8px;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}
.hist-item:active { transform: scale(.99); }
.hist-left { flex: 1; min-width: 0; }
.hist-game { font-size: 15px; font-weight: 600; }
.hist-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-right { flex: 0 0 auto; text-align: right; }
.hist-rank { font-size: 12px; color: var(--text-sub); }
.hist-rank.is-first { color: var(--main); font-weight: 600; }
.hist-score { margin-top: 2px; font-size: 17px; font-weight: 700; color: var(--main); }
.hist-total { margin-top: 1px; font-size: 11px; color: var(--text-faint); }

.hist-empty { padding: 48px 20px; text-align: center; }
.hist-empty-ico { font-size: 44px; line-height: 1.2; }
.hist-empty-tx {
  margin: 12px auto 0;
  max-width: 300px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
}
.hist-empty .acc-btn { margin-top: 18px; max-width: 220px; }
.hist-foot-row { margin: 10px 0 0; }

/* ===== 缺勤扣分醒目提醒（hall.js checkMissPenalty）===== */
.miss-warn { position: fixed; left: 12px; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 300; display: flex; align-items: center; gap: 10px;
  background: #FFF4E5; border: 2px solid #F5A623; border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 6px 24px rgba(245, 166, 35, .35); }
.miss-warn-ico { font-size: 22px; line-height: 1; }
.miss-warn-tx { flex: 1; font-size: 13px; color: #8A5A00; line-height: 1.6; font-weight: 500; }
.miss-warn-x { border: 0; background: #F5A623; color: #fff; border-radius: 10px;
  min-height: 34px; padding: 0 12px; font-size: 13px; font-family: inherit; cursor: pointer; flex: 0 0 auto; }

/* ===== 强制登录门槛（hall.js requireLogin，2026-10-13）=====
   2026-10-16 曾辉：不再是光秃秃一句话 + 一个按钮。第一次拿到链接的人（家人/朋友）
   需要先知道这里有什么 ⇒ 改成可滚动的欢迎页：一句话介绍 + 游戏规模 + 两个「先逛逛」入口
   （使用手册与场景指南 / 线下游戏百宝箱，都不用登录）。
   ⚠️ 布局用「外层 flex 滚动 + 内层 margin:auto」：内容短时垂直居中，内容长时能滚动。
      不能只写 justify-content:center + overflow:auto —— 那样内容超出会把顶部裁掉（滚不到顶）。 */
.login-gate { position: fixed; inset: 0; z-index: 200; background: var(--bg, #F7F8FC);
  display: flex; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom, 0px)); }
.lg-inner { margin: auto; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login-gate-ico { font-size: 56px; line-height: 1; }
.login-gate h2 { margin: 0; font-size: 22px; color: var(--text, #333); }
.login-gate-sub { margin: 0; max-width: 320px; font-size: 14px; color: var(--text-sub, #888); line-height: 1.7; }
.login-gate-btn { margin-top: 8px; min-width: 220px; min-height: 50px; border: 0; border-radius: 14px;
  background: var(--main, #5B6BD6); color: #fff; font-size: 17px; font-weight: 700; font-family: inherit; cursor: pointer; }
.login-gate-btn:active { opacity: .85; }
.login-gate-tip { margin: 4px 0 0; max-width: 330px; font-size: 12px; line-height: 1.7; color: var(--text-sub, #999); }
/* 「先逛逛」区：两个入口卡片，不用登录也能点 */
.lg-more { width: 100%; margin-top: 10px; padding-top: 14px; border-top: 1px dashed #E3DED2; }
.lg-more-h { margin: 0 0 10px; font-size: 12.5px; color: #9a9384; }
.lg-link { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
  min-height: 56px; padding: 10px 13px; margin-bottom: 8px; background: #fff;
  border: 1px solid #E8E2D8; border-radius: 14px; text-decoration: none; color: #3A3630; text-align: left; }
.lg-link:last-child { margin-bottom: 0; }
.lg-link:active { border-color: #2E7D5B; background: #F4FAF6; }
.lg-link-ico { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.lg-link-tx { flex: 1; min-width: 0; }
.lg-link-t { display: block; font-size: 15px; font-weight: 600; }
.lg-link-s { display: block; font-size: 12px; color: #8A8378; margin-top: 2px; line-height: 1.5; }
.lg-link-go { flex: 0 0 auto; color: #bdb4a4; font-size: 15px; }

/* ===== 推介区（2026-10-14）：未登录展开系统介绍，登录后收成一行 ===== */
.pitch { margin: 2px 12px 10px; background: linear-gradient(135deg, #FFF8EC, #F0F7F1);
  border: 1px solid #EFE6D2; border-radius: 16px; padding: 12px 14px 10px; position: relative; }
.pitch-lead { margin: 0 0 10px; font-size: 14.5px; line-height: 1.65; color: #4a4438; }
.pitch-lead b { color: #B26A00; }
.pitch-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pitch-cat { display: inline-flex; align-items: center; gap: 4px; padding: 7px 11px; background: #fff;
  border: 1px solid #e8e0cf; border-radius: 999px; font-size: 13.5px; color: #4a4438;
  text-decoration: none; cursor: pointer; }
.pitch-cat:active { border-color: #2E7D5B; }
.pitch-cat .n { color: #8a8172; font-size: 12px; }
.pitch-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pitch-link { padding: 7px 11px; background: #2E7D5B; color: #fff; border-radius: 999px;
  font-size: 13.5px; text-decoration: none; }
.pitch-link + .pitch-link { background: #FF8A3D; }
.pitch-toggle { position: absolute; top: 8px; right: 10px; border: 0; background: transparent;
  color: #a89e8c; font-size: 12.5px; padding: 6px; cursor: pointer; }
.pitch.is-mini .pitch-body { display: none; }
.pitch.is-mini { padding: 8px 14px; background: #fff; }
.pitch.is-mini::after { content: '📖 使用手册 · 🧺 线下百宝箱 ›'; display: block;
  font-size: 13.5px; color: #7a7264; }
.pitch.is-mini .pitch-toggle { top: 6px; }

/* ===== 家庭场次（2026-10-16）：把「一起玩」期间的对局归到一次活动上 =====
   条：今日推荐里那一行「这次一起玩 · N 局 · M 分钟」+「结束这次」。
   弹层：收尾时留一句话。点击区一律 ≥44px（见 MEMORY 的移动端纪律）。 */
.sess-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 9px; padding: 9px 11px;
  background: #FFF6E9; border: 1px solid #FFE0BE; border-radius: 12px;
  font-size: 13px; line-height: 1.5; color: #8A5A1E;
}
.sess-bar .sess-ico { font-size: 15px; }
.sess-bar .sess-tx { flex: 1; min-width: 0; }
.sess-bar .sess-end {
  flex: 0 0 auto; min-height: 34px; padding: 0 12px;
  border: 1px solid #F0C48A; border-radius: 999px; background: #fff;
  color: #B4691A; font-family: inherit; font-size: 13px; cursor: pointer;
}
.sess-bar .sess-end:active { background: #FFF1E0; }

.sess-mask {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(58, 46, 40, .45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.sess-card {
  position: relative; width: 100%; max-width: 340px; background: #fff;
  border-radius: 20px; padding: 26px 22px 20px; text-align: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .20);
}
.sess-close {
  position: absolute; top: 6px; right: 6px; width: 40px; height: 40px;
  border: none; border-radius: 50%; background: none; color: var(--text-faint);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.sess-close:active { background: rgba(0, 0, 0, .05); }
.sess-emoji { font-size: 38px; line-height: 1; }
.sess-title { margin: 10px 0 6px; font-size: 19px; font-weight: 700; color: var(--text); }
.sess-sub { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--text-sub); }
.sess-games {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin: 0 0 16px; padding: 0; list-style: none;
}
.sess-games li {
  padding: 5px 10px; background: var(--chip-bg, #F6F4EF); border-radius: 999px;
  font-size: 12.5px; color: #6B6355;
}
.sess-lab { display: block; margin: 0 0 8px; font-size: 13px; color: var(--text-sub); text-align: left; }
.sess-input {
  width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 14px;
  border: 1.5px solid #E5E0D6; border-radius: 12px; background: #FCFBF8;
  font-family: inherit; font-size: 15px; color: var(--text);
}
.sess-input:focus { outline: none; border-color: var(--main, #FF8A5B); }
.sess-err { margin: 8px 0 0; font-size: 13px; color: #F08A8A; text-align: left; }
.sess-btn {
  width: 100%; min-height: 48px; margin-top: 14px;
  border: none; border-radius: 14px; background: var(--main, #FF8A5B); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.sess-btn:active { opacity: .88; }
.sess-btn:disabled { opacity: .6; }
.sess-skip {
  width: 100%; min-height: 44px; margin-top: 8px;
  border: none; border-radius: 14px; background: none; color: var(--text-faint);
  font-family: inherit; font-size: 13.5px; cursor: pointer;
}

.recommend-options { display:flex; flex-wrap:wrap; gap:8px 16px; padding:4px 0 10px; }
.recommend-options label { display:flex; align-items:center; gap:8px; font-size:14px; }
.recommend-options select { min-height:44px; max-width:100%; padding:6px 10px; border:1px solid #ddd; border-radius:10px; background:#fff; color:#333; font:inherit; }
.recommend-options [hidden] { display:none; }
/* 「今日推荐」的折叠三角被移到这一行（2026-10-16 曾辉）——它不再在折叠按钮内部，
   所以得自己长成一个 44px 的可点按钮；靠右贴行尾。 */
.recommend-options .sec-fold-caret {
  margin-left: auto; align-self: center; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0;
  border: 0; background: transparent; color: var(--text-faint);
  font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.recommend-options .sec-fold-caret:active { opacity: .6; }

/* 管理入口出现时，小屏标题独占一行，避免挤压账号按钮。 */
@media (max-width: 480px) {
  .hall-head { flex-wrap: wrap; }
  .hall-head-text { flex-basis: 100%; }
}
