/* ==========================================================================
   大厅 · 重设计
   思路：把"表单 + 九宫格"换成"立绘主导的三区布局"。
   左：当前化身（图 + 名 + 技能，视觉主体）
   中：选角网格 + 进入对局（操作）
   右：多端加入 / 房间列表（次要信息）
   顶部只留品牌和实时人数。

   刻意压制的东西：卡片上的长段技能描述（挪到左侧大字区）、
   多余的边框线、所有纯色大块。
   ========================================================================== */

#lobby.panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 20px 24px 14px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

/* ---------- 顶栏 ---------- */
.lg-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 2px 2px;
}
.lg-brand h1 {
  margin: 0;
  font-family: 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: clamp(38px, 5.2vh, 56px);
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1.22;
  padding-top: 2px;
  background: linear-gradient(180deg, #fffaf1 0%, #e2cfb2 58%, #a98f70 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 22px rgba(200, 90, 55, .28));
}
.lg-brand > span {
  display: block;
  margin-top: 9px;
  font-size: 10.5px;
  letter-spacing: .40em;
  color: #776c62;
}
#hallStat {
  font-size: 11px;
  letter-spacing: .14em;
  color: #8e8378;
  text-align: right;
  line-height: 1.7;
}
#hallStat b { color: #e0c39a; font-weight: 600; }

/* ---------- 三区网格 ---------- */
.lg-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) 280px;
  gap: 16px;
  min-height: 0;
}

/* ========== 左：当前化身 ========== */
.lg-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .055);
  background:
    radial-gradient(130% 66% at 50% 104%, rgba(154, 44, 26, .38), transparent 64%),
    radial-gradient(90% 60% at 50% 0%, rgba(60, 48, 78, .30), transparent 70%),
    linear-gradient(180deg, #18141d 0%, #0a0810 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .52);
}
/* 立绘铺满可用区域，由 object-fit 决定怎么放。
   以前是 height:78% + width:auto，列一收窄图就比容器宽，
   overflow:hidden 把人物左右各削掉一截（948 宽时实测裁掉 174px）。
   注意：盒子必须给死 height，只写 inset 的话 img 会按宽度等比撑高，
   object-fit 等于没设（踩过一次）。

   两层 img 叠着：切换角色时新图直接盖上来，旧图淡出，
   不会像以前那样先淡到全黑、等 setTimeout 再换 src 才重新出现。 */
.lg-art-wrap {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: calc(100% - 62px);
  mix-blend-mode: screen;      /* 立绘黑底直接吃掉 */
  pointer-events: none;
}
.lg-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transition: opacity .14s ease;
  filter: drop-shadow(0 14px 44px rgba(0, 0, 0, .85));
  will-change: opacity;
}
/* 出场瞬时（新图直接可见），退场才淡出 —— 这样切换时不会有重影，
   也不会出现"先黑一下"的空档 */
.lg-art.show { opacity: 1; transition: none; }
.lg-hero-grad {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    transparent 46%,
    rgba(7, 6, 10, .55) 72%,
    rgba(7, 6, 10, .94) 90%,
    #07060a 100%);
}
.lg-hero-meta {
  position: absolute; left: 20px; right: 20px; bottom: 18px;
}
.lg-hero-idx {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 10px;
  letter-spacing: .18em;
  color: rgba(217, 168, 106, .5);
}
.lg-hero-idx b { font-size: 14px; color: #d9a86a; font-weight: 500; }
.lg-hero-idx i { font-style: normal; margin-left: 3px; }
.lg-hero-meta h2 {
  margin: 7px 0 9px;
  font-family: 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: clamp(28px, 3.8vh, 40px);
  font-weight: 900;
  letter-spacing: .06em;
  color: #f8f2e9;
  text-shadow: 0 4px 26px rgba(0, 0, 0, .8);
}
.lg-chip {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: #ffd8c2;
  background: rgba(214, 65, 42, .18);
  border: 1px solid rgba(214, 65, 42, .42);
}
.lg-hero-meta p {
  margin: 11px 0 0;
  font-size: 11.5px;
  line-height: 1.72;
  color: #9b9096;
}

/* ========== 中：选角 + 操作 ========== */
.lg-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 18px 20px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: linear-gradient(168deg, rgba(33, 28, 39, .62) 0%, rgba(11, 9, 15, .76) 100%);
  backdrop-filter: blur(26px) saturate(155%);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .46),
    inset 0 1px 0 rgba(255, 255, 255, .065);
}
.lg-sec { display: flex; flex-direction: column; min-height: 0; }
.lg-sec:first-child { flex: 1 1 auto; }
.lg-sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.lg-sec-head > span {
  position: relative;
  padding-left: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  color: #ece0cd;
}
.lg-sec-head > span::before {
  content: '';
  position: absolute; left: 0; top: 2px; bottom: 2px; width: 2px;
  background: linear-gradient(180deg, #d6412a, rgba(214, 65, 42, .15));
}
.lg-sec-head > i {
  font-size: 10px;
  font-style: normal;
  letter-spacing: .06em;
  color: #6d635f;
}

/* 选角网格：3 列。卡片上只留"图 + 名 + 技能标签"，
   长描述挪到左侧大字区——这是解决拥挤感的关键一步。 */
#heroCards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  grid-auto-rows: minmax(0, 1fr);   /* 三行均分：既不会撑爆，也不会在下面空一大块 */
  padding-right: 2px;
}
#heroCards .hcard {
  position: relative;
  height: auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 7px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .045);
  background: linear-gradient(180deg, rgba(50, 43, 58, .38) 0%, rgba(11, 9, 17, .60) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.22, .61, .36, 1),
              border-color .18s, box-shadow .18s, background .18s;
}
.hcard::before {
  /* 顶光，替代原来那团径向暖光 */
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 52% at 50% 0%, rgba(200, 158, 104, .10), transparent 68%);
  pointer-events: none;
}
#heroCards .hcard:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .13);
  background: linear-gradient(180deg, rgba(62, 53, 70, .46) 0%, rgba(14, 11, 20, .64) 100%);
}
#heroCards .hcard.picked {
  border-color: rgba(214, 65, 42, .62);
  background: linear-gradient(180deg, rgba(80, 30, 25, .52) 0%, rgba(22, 11, 14, .66) 100%);
  box-shadow:
    0 0 0 1px rgba(214, 65, 42, .22),
    0 0 28px rgba(214, 65, 42, .18),
    inset 0 1px 0 rgba(255, 186, 156, .18);
}
#heroCards .hport {
  height: 58px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}
.hport::after {
  /* 脚下地面光 */
  content: '';
  position: absolute; left: 50%; bottom: -2px;
  width: 70%; height: 10px; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(200, 158, 104, .20), transparent 72%);
  filter: blur(3px);
  pointer-events: none;
}
.hcard.picked .hport::after {
  background: radial-gradient(50% 50% at 50% 50%, rgba(214, 65, 42, .34), transparent 72%);
}
.hport .fig {
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .8));
}
#heroCards .hname {
  margin-top: 7px;
  font-family: system-ui, 'PingFang SC', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #f2ebe1;
  text-align: center;
  line-height: 1.2;
}
/* 卡片上不要长描述：font-size 0 收掉文本节点，只留 <b> 的技能名 */
#heroCards .hskill {
  margin-top: 4px;
  font-size: 0;
  min-height: 0;
  line-height: 1;
}
#heroCards .hskill b {
  display: block;
  font-family: system-ui, 'PingFang SC', sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .16em;
  color: #cfa173;
}
.hpick {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; padding: 0;
  border-radius: 50%;
  background: #ff5334;
  border: 0;
  font-size: 0;
  box-shadow: 0 0 10px rgba(255, 83, 52, .9);
  opacity: 0;
  transition: opacity .16s;
}
.hcard.picked .hpick { opacity: 1; }

/* 进入对局 */
.lobby-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .72fr) 130px;
  gap: 8px;
  align-items: end;
}
.lobby-inputs > div { min-width: 0; }
.lbl {
  display: block;
  margin-bottom: 5px;
  font-size: 9.5px;
  letter-spacing: .22em;
  color: #776c62;
}
.lobby-inputs input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .035);
  color: #f0e8dd;
  font-size: 13px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.lobby-inputs input::placeholder { color: #5f5651; }
.lobby-inputs input:hover { border-color: rgba(255, 255, 255, .13); }
.lobby-inputs input:focus {
  outline: none;
  border-color: rgba(214, 65, 42, .62);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(214, 65, 42, .12);
}
button.primary {
  width: 100%;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 132, 100, .30);
  background: linear-gradient(135deg, #cf3f2a 0%, #a32f20 55%, #85261a 100%);
  color: #fff6f1;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .26em;
  box-shadow:
    0 8px 24px rgba(190, 50, 30, .34),
    inset 0 1px 0 rgba(255, 196, 174, .32);
  cursor: pointer;
  transition: background .18s, box-shadow .18s, transform .1s;
}
button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #e0492f 0%, #b53623 55%, #942b1d 100%);
  box-shadow: 0 10px 32px rgba(214, 62, 38, .46), inset 0 1px 0 rgba(255, 208, 188, .38);
}
button.primary:active:not(:disabled) { transform: translateY(1px); }

.match-row { margin-top: 9px; }
.match-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .032);
  color: #ddd2c6;
  text-align: left;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
.match-btn:hover {
  background: rgba(255, 255, 255, .062);
  border-color: rgba(214, 65, 42, .38);
}
.mb-main {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  color: #f2e9de;
}
.mb-sub {
  font-size: 10px;
  letter-spacing: .04em;
  color: #7a706a;
}

/* ========== 右：多端 + 房间 ========== */
.lg-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.lg-side .joinbox,
.lg-side .rooms {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .055);
  background: linear-gradient(168deg, rgba(30, 25, 36, .58) 0%, rgba(9, 7, 13, .74) 100%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .05);
  overflow: hidden;
}
.lg-side .rooms {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.joinbox-head,
.rooms-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 15px 10px;
}
.joinbox-head span,
.rooms-head span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #e8dccd;
}
.joinbox-head i,
.rooms-head i {
  font-size: 9.5px;
  font-style: normal;
  color: #6b615c;
}
.joinbox-body { padding: 0 15px 15px; }
.join-start-btn {
  width: 100%;
  padding: 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .05);
  color: #ddd2c6;
  font-size: 12px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
.join-start-btn:hover { background: rgba(255, 255, 255, .085); border-color: rgba(214, 65, 42, .4); }
.join-gate-tip { margin-top: 8px; font-size: 10px; line-height: 1.6; color: #6b615c; }
.room-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 12px 12px; }
.room-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 110px;
  border: 1px dashed rgba(255, 255, 255, .07);
  border-radius: 12px;
  font-size: 10.5px;
  line-height: 1.8;
  color: #6b615c;
  text-align: center;
  padding: 16px 12px;
  box-sizing: border-box;
}

/* ========== 底部入口 ========== */
.lobby-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  /* 必须显式抬层：.menu-bg 是 fixed + z-index:0，
     会把没有定位的普通流元素整个盖住。中间的玻璃面板因为有
     backdrop-filter 自动生成了层叠上下文才幸免，底部这排按钮没有，
     所以一直"存在但看不见"。 */
  position: relative;
  z-index: 2;
}
.lg-head { position: relative; z-index: 2; }
.lg-grid { position: relative; z-index: 1; }
.menu-link {
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .055);
  color: #b3a89a;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s, background .18s, border-color .18s;
}
.menu-link:hover {
  color: #f0dcc6;
  background: rgba(214, 65, 42, .13);
  border-color: rgba(214, 65, 42, .38);
}

/* ========== 小屏收敛 ==========
   原则：立绘是这块大厅的主角，任何时候都不能消失。
   只分层砍"宽度需求大、信息次要"的东西：先砍右栏，再收立绘列宽，
   最后才在手机竖屏把它改成顶部横条——而不是 display:none。 */
@media (max-width: 1180px) {
  /* 原来这里是 .lg-hero{display:none}。1280 / 1366 的笔记本窗口一开，
     左边整块人物展示直接消失 —— 玩家看到的就是"选角是一堆小卡，没人"，
     等于这块白做。改成缩窄列宽保留。 */
  .lg-grid { grid-template-columns: 262px minmax(0, 1fr) 238px; gap: 12px; }
  /* 列一窄，按高度等比缩放的图就只剩一小截（196 宽时只有 249 高，
     843 高的容器里空一大块）。改成铺满取景、镜头压到胸口以上，
     人物填满竖条——这是游戏 UI 里更常见的做法。 */
  .lg-art-wrap { height: 100%; }
  .lg-art { object-fit: cover; object-position: center 6%; }
  .lg-hero-meta { left: 14px; right: 14px; bottom: 13px; }
  .lg-hero-meta h2 { font-size: 26px; margin: 6px 0 7px; }
  .lg-hero-meta p { font-size: 10.5px; line-height: 1.6; margin-top: 8px; }
}
@media (max-width: 1040px) {
  /* 右栏（多端加入 + 房间列表）让位：它本来就是"另一台设备"的补充入口。
     立绘列反而要保住宽度，否则人物被挤成一条。 */
  #lobby { padding: 16px 16px 10px; }
  .lg-grid { grid-template-columns: 248px minmax(0, 1fr); gap: 10px; }
  .lg-side { display: none; }
  .lg-hero-meta { left: 12px; right: 12px; bottom: 11px; }
  .lg-hero-idx { font-size: 9px; }
  .lg-hero-idx b { font-size: 12px; }
  .lg-hero-meta h2 { font-size: 21px; margin: 4px 0 6px; letter-spacing: .04em; }
  .lg-hero-meta p { font-size: 9.5px; line-height: 1.55; margin-top: 6px; }
  .lg-chip { font-size: 9.5px; padding: 2px 7px; }
  .lg-main { padding: 14px 14px 14px; }
}
@media (max-width: 780px) {
  /* 再窄就不硬塞竖列了：立绘横过来放最上面，人物照样在，只是换了朝向 */
  .lg-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: 178px minmax(0, 1fr); }
  .lg-hero { display: block; }
  .lg-art-wrap { height: 100%; }
  .lg-art { object-fit: cover; object-position: center 14%; }
  .lg-hero-grad {
    background: linear-gradient(180deg, rgba(7,6,10,.62) 0%, transparent 34%,
      rgba(7,6,10,.74) 76%, #07060a 100%);
  }
  .lg-hero-meta { left: 14px; right: 14px; bottom: 10px; }
  .lg-hero-meta h2 { font-size: 19px; margin: 2px 0 0; }
  .lg-hero-meta p, .lg-hero-idx { display: none; }
  .hero-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lobby-inputs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lobby-inputs .join-cell { grid-column: 1 / -1; }
}

/* ========== 进入对局：两条路 ==========
   以前是一个表单塞了代号/房间号/密码/潜入 四行，外加一个匹配按钮，
   新玩家第一眼根本分不清「我要一个人玩」还是「我要约人」。
   现在拆成两张卡：左边单人匹配，右边约人，点右边才展开建/加入。 */
.play-modes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 13px 15px 14px;
  text-align: left;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: linear-gradient(160deg, rgba(58, 48, 64, .42) 0%, rgba(12, 10, 18, .62) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  color: #e9ddca;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .12s;
}
.mode-card:hover {
  border-color: rgba(214, 65, 42, .42);
  background: linear-gradient(160deg, rgba(78, 50, 58, .5) 0%, rgba(16, 12, 20, .7) 100%);
}
.mode-card:active { transform: scale(.985); }
.mode-card b { font-size: 13.5px; font-weight: 600; letter-spacing: .06em; }
.mode-card i {
  font-style: normal;
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: .02em;
  color: #8d8179;
}
.mode-card.busy { opacity: .55; pointer-events: none; }
.mode-card.on {
  border-color: rgba(214, 65, 42, .55);
  background: linear-gradient(160deg, rgba(96, 40, 32, .46) 0%, rgba(20, 11, 14, .72) 100%);
}

.friend-panel {
  margin-top: 9px;
  padding: 12px 13px 13px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: rgba(12, 10, 17, .5);
}
.fr-create {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: .14em;
}
.fr-or {
  margin: 11px 0 9px;
  text-align: center;
  font-size: 10px;
  letter-spacing: .16em;
  color: #6b615c;
}
.fr-joinrow { display: flex; gap: 8px; }
#roomCode {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(0, 0, 0, .38);
  color: #f2e6d4;
  font: 600 15px/1 ui-monospace, 'SF Mono', Consolas, monospace;
  letter-spacing: .22em;
  text-transform: uppercase;
}
#roomCode::placeholder { color: #4f4844; letter-spacing: .12em; font-weight: 400; }
#roomCode:focus { outline: none; border-color: rgba(214, 65, 42, .55); }
#joinRoomBtn {
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .07);
  color: #e9ddca;
  font-size: 12.5px;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
#joinRoomBtn:hover { background: rgba(214, 65, 42, .26); border-color: rgba(214, 65, 42, .5); }

/* 左上角账号 */
.lg-head-right { display: flex; align-items: flex-end; gap: 16px; }
.lg-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
}
.lg-user[hidden] { display: none; }
.lu-name {
  font-size: 11.5px;
  letter-spacing: .08em;
  color: #cbb9a0;
}
.lu-name::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: #6fbf73;
  box-shadow: 0 0 8px rgba(111, 191, 115, .8);
  vertical-align: middle;
}
.lu-out {
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: none;
  color: #7d716a;
  font-size: 10px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: color .16s, border-color .16s;
}
.lu-out:hover { color: #e0b3a4; border-color: rgba(214, 65, 42, .42); }

@media (max-width: 780px) {
  .play-modes { grid-template-columns: minmax(0, 1fr); }
}

/* ========== 好友 ==========
   做成右侧抽屉：加人、看谁在线、点邀请，三件事在同一个面板里完成。
   不做成新页面，是因为玩家常常在对局等着开局的时候才想起「忘了叫人」。 */
.lu-friends {
  position: relative;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: #cbb9a0;
  font-size: 10.5px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
.lu-friends:hover { color: #f0dcc0; border-color: rgba(214, 65, 42, .45); background: rgba(214, 65, 42, .16); }
.lu-friends i {
  display: inline-block;
  min-width: 14px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 7px;
  background: #d6412a;
  color: #fff;
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: 1px;
}
.lu-friends i[hidden] { display: none; }

.fd { position: fixed; inset: 0; z-index: 620; }
.fd[hidden] { display: none; }
.fd-mask {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 6, .5);
  backdrop-filter: blur(2px);
  animation: fdFade .18s ease both;
}
@keyframes fdFade { from { opacity: 0; } to { opacity: 1; } }

.fd-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 336px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 14px;
  border-left: 1px solid rgba(255, 255, 255, .07);
  background: linear-gradient(200deg, #171219 0%, #0d0a10 62%, #08060b 100%);
  box-shadow: -24px 0 64px rgba(0, 0, 0, .6);
  animation: fdSlide .22s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes fdSlide { from { transform: translateX(22px); opacity: 0; } to { transform: none; opacity: 1; } }

.fd-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.fd-head span {
  display: block;
  font: 600 15px/1.2 'Songti SC', 'STSong', serif;
  letter-spacing: .18em;
  color: #f0e0c6;
}
.fd-head i {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: .1em;
  color: #7d716a;
}
.fd-x {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: none;
  color: #8b7f76;
  font-size: 12px;
  cursor: pointer;
  transition: color .16s, border-color .16s;
}
.fd-x:hover { color: #e6cbba; border-color: rgba(214, 65, 42, .45); }

.fd-add { display: flex; gap: 7px; }
.fd-add input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(0, 0, 0, .4);
  color: #f2e6d4;
  font-size: 12.5px;
}
.fd-add input::placeholder { color: #554d48; }
.fd-add input:focus { outline: none; border-color: rgba(214, 65, 42, .5); }
.fd-add button {
  height: 36px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid rgba(214, 65, 42, .45);
  background: rgba(214, 65, 42, .2);
  color: #f0c8b8;
  font-size: 12px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: background .16s;
}
.fd-add button:hover { background: rgba(214, 65, 42, .38); }
.fd-add button:disabled { opacity: .5; cursor: default; }

.fd-msg {
  min-height: 15px;
  margin: 7px 0 2px;
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: .02em;
  color: #a99887;
}
.fd-msg.bad { color: #e0896f; }
.fd-msg.good { color: #85c98a; }

.fd-list {
  flex: 1;
  overflow-y: auto;
  margin: 4px -4px 0;
  padding: 0 4px;
}
.fd-list::-webkit-scrollbar { width: 4px; }
.fd-list::-webkit-scrollbar-thumb { border-radius: 2px; background: rgba(255, 255, 255, .1); }

.fd-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 10px;
  transition: background .14s;
}
.fd-row:hover { background: rgba(255, 255, 255, .035); }
.fd-row + .fd-row { margin-top: 1px; }
.fd-dot {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #443c37;
}
.fd-dot.on {
  background: #6fbf73;
  box-shadow: 0 0 9px rgba(111, 191, 115, .85);
}
.fd-who { flex: 1; min-width: 0; }
.fd-who b {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: #e6d8c4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fd-who span { display: block; margin-top: 2px; font-size: 9.5px; letter-spacing: .04em; color: #756a63; }
.fd-row.off .fd-who b { color: #8b8079; }

.fd-inv {
  flex: 0 0 auto;
  height: 25px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(214, 65, 42, .42);
  background: rgba(214, 65, 42, .16);
  color: #efc2b1;
  font-size: 10px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .16s;
}
.fd-inv:hover { background: rgba(214, 65, 42, .36); }
.fd-inv:disabled { opacity: .45; cursor: default; }

.fd-del {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border: none;
  border-radius: 6px;
  background: none;
  color: #5b524c;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color .14s, background .14s;
}
.fd-del:hover { color: #e0896f; background: rgba(214, 65, 42, .16); }

.fd-empty {
  padding: 26px 10px;
  text-align: center;
  font-size: 11px;
  line-height: 1.8;
  color: #6b615a;
}
.fd-tip {
  margin: 10px 0 0;
  font-size: 9.5px;
  line-height: 1.6;
  letter-spacing: .02em;
  color: #544b46;
  text-align: center;
}

/* 邀请条：塞在顶栏那一行里，高度刚好不压到下面的化身卡。
   一开始做的是 268px 的卡片浮窗，1440 下正好盖住第一排角色，改窄。 */
.invite-pop {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 640;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(560px, calc(100vw - 28px));
  padding: 7px 9px 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 170, .18);
  background: linear-gradient(158deg, rgba(58, 38, 34, .96), rgba(12, 9, 15, .97));
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 244, 216, .14);
  animation: invIn .24s cubic-bezier(.22, .61, .36, 1) both;
}
.invite-pop[hidden] { display: none; }
@keyframes invFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes invIn {
  from { transform: translateX(-50%) translateY(-10px); opacity: 0; }
  to { transform: translateX(-50%); opacity: 1; }
}
.invite-pop .iv-t {
  flex: 0 0 auto;
  font-size: 9px;
  letter-spacing: .18em;
  color: #d9a86a;
}
.invite-pop .iv-who {
  flex: 0 0 auto;
  max-width: 120px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .03em;
  color: #f4e6cf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.invite-pop .iv-sub {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: #9c8f86;
  white-space: nowrap;
}
.invite-pop .iv-room {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .45);
  font: 600 11px/1.5 ui-monospace, Consolas, monospace;
  letter-spacing: .16em;
  color: #e8d3ae;
}
.invite-pop .iv-act { flex: 0 0 auto; display: flex; gap: 6px; }
.invite-pop button {
  height: 27px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.invite-pop .iv-ok {
  border: 1px solid rgba(214, 65, 42, .6);
  background: rgba(214, 65, 42, .38);
  color: #ffe2d4;
}
.invite-pop .iv-ok:hover { background: rgba(214, 65, 42, .58); }
.invite-pop .iv-no {
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: #a2918a;
}
.invite-pop .iv-no:hover { background: rgba(255, 255, 255, .09); }

@media (max-width: 780px) {
  .fd-panel { width: 100vw; max-width: 100vw; border-left: none; }
  /* 窄屏放不下横条：换两行，动画也只能用纯淡入 */
  .invite-pop {
    left: 10px; right: 10px; top: 72px; max-width: none;
    transform: none; flex-wrap: wrap; justify-content: center;
    border-radius: 14px; animation: invFade .2s ease both;
  }
  .invite-pop .iv-sub { display: none; }
}

/* ========== 手机竖屏（≤560）：顶栏折两行、底栏换行 ==========
   390 宽下原来的单行顶栏会把「伪 人」挤成两行、把「退出」压成竖排；
   底部四个胶囊也放不下，文字被切成两行。这里让它们各自换行，不再抢宽度。 */
@media (max-width: 560px) {
  .lg-head { flex-wrap: wrap; align-items: flex-end; gap: 2px 10px; }
  .lg-brand { flex: 0 0 auto; }
  .lg-brand h1 { font-size: 34px; letter-spacing: .1em; white-space: nowrap; }
  .lg-brand > span { margin-top: 4px; font-size: 9px; letter-spacing: .2em; white-space: nowrap; }
  .lg-head-right {
    flex: 1 1 100%;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
  }
  .lg-user { gap: 6px; padding-bottom: 0; }
  .lu-name {
    font-size: 11px; max-width: 84px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .lu-out, .lu-friends { white-space: nowrap; flex: 0 0 auto; }
  #hallStat { font-size: 10px; line-height: 1.5; text-align: right; }

  .lobby-foot { flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 0 2px; }
  .menu-link {
    padding: 6px 12px; font-size: 10px; letter-spacing: .06em; white-space: nowrap;
  }
}
