/* ============================================================================
 * group-chat.v1.css — 多人聊天·群聊视图样式（任务 G-3）
 * ----------------------------------------------------------------------------
 * 职责：#view-group 群聊视图全部样式。独立文件，禁止写入 style.v54.css（工人 C 占用）。
 * v249：群聊旧纸材质化——去现代渐变圆角气泡，对齐单聊「剧本台词本 + 三张旧纸」规范。
 *   白底浅米 + 暖棕 sepia + 楷体，去框感阴影，还原千禧旧纸实体质感。
 * ========================================================================== */

/* ---------- 容器（对齐单聊：全高、内容居中） ---------- */
/* v470：改为与 #view-chat 一致的 fixed 全屏覆盖。
   原来 #view-group 是普通文档流，会被上面的 header.topbar（约 103px）往下挤，
   于是 .group-wrap 的 100vh 从 topbar 之下开始算，整块底边超出视口，
   输入栏落到屏幕外（表现为"进了群聊但看不到输入框/底部"）。
   单聊 #view-chat 正是用 fixed inset:0 解决同一问题，这里保持一致。 */
#view-group { display: none; }
#view-group.active {
  display: block;
  position: fixed;
  inset: 0;
  /* v476：必须高于 .place-modal（z-index:1000）与 .gl-modal（1300）。
     多聊是从地点弹窗里发起的，若层级低于它，地点弹窗连同 --place-bg 背景大图
     会整个盖在聊天界面上。 */
  z-index: 1600;
  height: 100vh;
  overflow-y: auto;
  background: #f4ecd9;
}

.group-wrap {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ---------- 顶栏：群名（地点 · 名字1 & 名字2(+N)） ---------- */
.group-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: url('../assets/input-paper.webp') repeat;
  border-bottom: 1px solid rgba(143, 47, 33, .16);
  flex-shrink: 0;
}
.group-topbar .btn-back {
  border: 1px solid rgba(143, 47, 33, .35);
  background: rgba(255, 250, 238, .4);
  color: var(--accent, #8f2f21);
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: none;
}
.group-topbar .btn-back:hover { background: var(--accent, #8f2f21); color: #fff; }
.group-title {
  flex: 1;
  min-width: 0;
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
  font-size: 20px;
  color: #4a2c17;
  letter-spacing: 2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-spacer { width: 64px; flex-shrink: 0; } /* 与左侧返回按钮等宽，保证标题居中 */

/* ---------- 对话区 ---------- */
.group-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.group-conv {
  width: min(760px, 94vw);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}
/* v249：群聊纸——单聊同款自然磨损旧纸，固定窗口传送带式滚动 */
.group-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 52px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* v307：纸图已裁掉上下透明带（1040×1399 无缝）——?v307 破缓存 */
  background-image: url('../assets/chat-paper-clean.webp?v332');
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 100% auto;
  background-attachment: local;
}

/* ---------- 群聊立绘区（v295）：成员立绘横向排开居中 ---------- */
.group-portraits {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 0 2px;
  width: min(760px, 94vw);
  transition: opacity .25s;
}
.group-portraits .gp-img {
  display: block;
  object-fit: cover;
  object-position: 50% 0%;
  border: none; border-radius: 0; box-shadow: none;
  background: transparent;
  /* 旧纸暖棕 tint（同单聊立绘）：弱化贴纸感 */
  filter: sepia(.18) saturate(.92);
  /* 底部柔化渐隐（同单聊） */
  -webkit-mask-image: linear-gradient(180deg, #000 74%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(180deg, #000 74%, rgba(0,0,0,0) 100%);
}
/* 桌面：按人数定宽（人越多越窄，横向放得下） */
.group-portraits.gp-2 .gp-img { width: 168px; height: 176px; }
.group-portraits.gp-3 .gp-img { width: 132px; height: 142px; }
.group-portraits.gp-4 .gp-img { width: 104px; height: 116px; }
/* 输入时隐藏立绘（同单聊 chat-typing），扩大聊天区 */
body.chat-typing .group-portraits { display: none !important; }
/* ======== v309 群聊舞台式（body.group-stage-on） ======== */
/* 消息列表隐藏；输入栏吸底（消息区隐藏后 inputbar 是唯一子元素，flex 默认靠顶）
   v309修正：group-conv 改 flex:0（原 flex:1 与立绘区平分剩余，立绘和输入栏之间留空隙、立绘偏高） */
body.group-stage-on .group-messages { display: none !important; }
body.group-stage-on .group-inputbar { margin-top: auto; }
body.group-stage-on .group-conv { flex: 0 0 auto; }
/* v373：舞台模式横向拉宽到整个屏幕，立绘区可容纳更多角色；顶栏/输入栏仍保持 960px 居中 */
body.group-stage-on .group-wrap { max-width: none; }
body.group-stage-on .group-topbar,
body.group-stage-on .group-inputbar { width: min(960px, 100%); margin-left: auto; margin-right: auto; }
/* 立绘区：舞台式放大横排居中；立绘靠下（输入栏上方），角色间距拉开防气泡重叠 */
body.group-stage-on .group-portraits {
  flex: 1;
  align-items: flex-end;       /* v309修正：立绘靠底部（输入栏上方），原 center 导致立绘太高 */
  gap: 32px;                   /* 角色间距拉开（原 6px，气泡会重叠） */
  padding: 20px 0 24px;
  width: 100%;
}
body.group-stage-on .group-portraits .gp-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0%;
}
body.group-stage-on .group-portraits.gp-2 .gp-img { width: 290px; height: 310px; }
body.group-stage-on .group-portraits.gp-3 .gp-img { width: 240px; height: 260px; }
body.group-stage-on .group-portraits.gp-4 .gp-img { width: 195px; height: 215px; }
/* 角色 slot：立绘 + 头顶气泡（气泡 absolute 在立绘上方，尖尖朝下指向角色） */
.gp-slot { position: relative; display: flex; align-items: flex-end; }
/* v375：惊讶=立绘跳起动作（不换图） */
.gp-slot.gp-jump { animation: gp-jump .55s ease; }
@keyframes gp-jump {
  0% { transform: translateY(0); }
  30% { transform: translateY(-16px); }
  55% { transform: translateY(0); }
  75% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}
/* v375：害羞=脸颊红晕（不换图，与单聊脸红机制一致） */
.gp-slot::after {
  content: ''; position: absolute; left: 50%; top: 22%; width: 56%; height: 15%;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,88,88,.22), rgba(255,88,88,0) 70%);
  opacity: 0; pointer-events: none; transition: opacity .6s ease; z-index: 2;
}
.gp-slot.gp-shy::after { opacity: 1; }
/* v415：群聊舞台旁白框（照搬主线剧情样式） */
#group-narrator-stage {
  position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%);
  max-width: 56%; padding: 8px 18px;
  font-family: 'KaiTi','STKaiti','楷体',serif; font-style: italic;
  font-size: 15px; line-height: 1.6; text-align: center;
  color: #f6ecdc; text-shadow: 0 1px 3px rgba(0,0,0,.9);
  background: rgba(20,12,8,.88); border-radius: 10px; z-index: 5; pointer-events: none;
}
@media (max-width:768px){
  #group-narrator-stage{top:48px;bottom:auto;width:calc(100vw - 16px);max-width:none;font-size:12px;padding:6px 10px;}
}
/* v386：舞台演出增强——入场/退场/切表情淡入淡出 */
.gp-img { transition: opacity .2s ease; }
.gp-slot.gp-enter { animation: gp-enter .35s ease; }
@keyframes gp-enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.gp-slot.gp-leave { animation: gp-leave .25s ease forwards; }
@keyframes gp-leave {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}
.gp-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 180px;   /* v309：收窄（原 220px），4 人时相邻气泡不重叠 */
  background: #f7eedd;
  border: 1px solid rgba(120, 90, 60, .35);
  border-radius: 10px;
  padding: 7px 12px;
  color: #3f2f1d;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: 0 3px 12px rgba(80, 55, 30, .18);
  z-index: 5;
  white-space: pre-wrap;
  word-break: break-word;
}
.gp-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #f7eedd;
}
/* 玩家气泡（群聊舞台式）：左侧，尖尖指向输入框方向 */
#g-sm-player-bubble {
  position: absolute;
  left: 0.5%;
  bottom: 108px;
  width: 20%;
  min-width: 0;
  box-sizing: border-box;
  background: #f7eedd;
  border: 1px solid rgba(120, 90, 60, .35);
  border-radius: 10px;
  padding: 8px 14px;
  color: #5a4630;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 3px 12px rgba(80, 55, 30, .18);
  z-index: 5;
  white-space: pre-wrap;
  word-break: break-word;
}
#g-sm-player-bubble::after {
  content: '';
  position: absolute;
  left: 20%;
  bottom: -8px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #f7eedd;
}
/* ======== v313 手机端气泡堆叠（最近 2 条，新的顶上去，尖尖各自指向说话角色） ======== */
.g-bubble-stack {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 220px;            /* v316：固定最低位置（气泡底部贴立绘头顶上方），新气泡从底部加入、旧的往上顶；原 top 固定最高点 */
  transform: translateX(-50%);
  width: 82vw;
  max-width: 340px;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 6;
  pointer-events: none;
}
.g-bubble-stack .g-stack-item {
  position: relative;       /* 尖尖 absolute 相对 item */
  max-width: 100%;
  background: #f7eedd;
  border: 1px solid rgba(120, 90, 60, .35);
  border-radius: 10px;
  padding: 6px 12px;
  box-shadow: 0 3px 12px rgba(80, 55, 30, .18);
  display: flex;
  flex-direction: column;
}
/* 尖尖：朝下，水平位置由 JS 按说话者立绘偏移（--tip-x） */
.g-stack-item::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: calc(50% + var(--tip-x, 0px));
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #f7eedd;
}
.g-stack-item .g-stack-name {
  font-size: 11px;
  color: #8a6f4d;
  margin-bottom: 2px;
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
}
.g-stack-item .g-stack-text {
  font-size: 14px;
  line-height: 1.6;
  color: #3f2f1d;
  white-space: pre-wrap;
  word-break: break-word;
}
/* 手机端舞台式：隐藏每角色头顶气泡，改用堆叠 */
@media (max-width: 768px) {
  body.group-stage-on .gp-bubble { display: none !important; }
  body.group-stage-on .g-bubble-stack { display: flex; }
}
/* 移动端：按人数进一步缩小（横向距离小） */
@media (max-width: 768px) {
  .group-portraits { gap: 3px; padding: 4px 0 0; width: 100%; }
  .group-portraits.gp-2 .gp-img { width: 104px; height: 112px; }
  .group-portraits.gp-3 .gp-img { width: 78px; height: 86px; }
  .group-portraits.gp-4 .gp-img { width: 60px; height: 68px; }
}

/* ---------- 消息行（v249：剧本台词本化，去气泡） ---------- */
.gmsg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: g-fadeIn .25s;
}
.gmsg.user { flex-direction: row-reverse; }

/* 说话者名字：纯文字（v293：删掉色块——原深色底+深字对比度低看不清；无背景最干净） */
.gspeaker {
  flex-shrink: 0;
  max-width: 96px;
  padding: 2px 4px;
  border-radius: 0;
  color: #4a2c17;
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
  margin-top: 2px;
  user-select: none;
}

/* 台词正文：无框旧纸风，说话名色块右侧一行台纸文本 */
.gmsg-bubble {
  max-width: 72%;
  padding: 2px 4px;
  border-radius: 0;
  font-size: 14.5px;
  line-height: 1.85;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #3f2f1d;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}
.gmsg.user .gmsg-bubble {
  background: transparent;
  color: #6b4a2b;
  text-align: right;
}

/* 旁白 / 系统提示：灰色小字居中，无名字色块 */
.gmsg.system { justify-content: center; }
.gmsg.system .gspeaker { display: none; }
.gmsg.system .gmsg-bubble {
  background: transparent;
  color: #8a6f4d;
  font-size: 12.5px;
  border-radius: 0;
  padding: 0 16px;
  font-style: italic;
  max-width: 90%;
  border: none;
  box-shadow: none;
  text-align: center;
}

/* H-2（契约 §9）：轮到玩家轻提示条——复用旁白样式，仅更淡、正常体，不新增控件 */
.gmsg-turn-hint { opacity: .8; }
.gmsg-turn-hint .gmsg-bubble { font-style: normal; }

/* ---------- 输入栏 ---------- */
.group-inputbar {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 0 14px;
}
#group-input {
  flex: 1;
  min-width: 0;
  resize: none;
  border: none;
  border-radius: 4px;
  background: url('../assets/modal-paper.webp') no-repeat;
  background-size: 100% 100%;
  color: #4a2c17;
  font-size: 14px;
  padding: 10px 16px;
  outline: none;
  line-height: 1.5;
  max-height: 120px;
  font-family: inherit;
  box-sizing: border-box;
  box-shadow: none;
}
#group-input:focus { box-shadow: 0 0 0 2px rgba(143, 47, 33, .14); }
#btn-group-send {
  border: none;
  background: #8f2f21;
  color: #fff;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  flex-shrink: 0;
  box-shadow: none;
}
#btn-group-send:hover { background: #a5382a; }
#btn-group-send:disabled { opacity: .55; cursor: not-allowed; }
.group-loading {
  position: absolute;
  right: 8px;
  top: -22px;
  font-size: 12px;
  color: #9b8468;
  background: rgba(255, 250, 238, .85);
  padding: 3px 10px;
  border-radius: 4px;
  pointer-events: none;
}
.group-loading.hidden { display: none; }

/* ---------- 动画（自包含，避免依赖 style.v54.css 的 keyframes） ---------- */
@keyframes g-fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 移动端：无横向溢出 ---------- */
@media (max-width: 768px) {
  .group-topbar { padding: 6px 10px; gap: 8px; }
  .group-topbar .btn-back { font-size: 12px; padding: 4px 10px; }
  .group-title { font-size: 16px; letter-spacing: 1px; }
  .group-spacer { width: 52px; }
  .group-conv { width: 100%; max-width: 100%; padding-top: 6px; }
  .group-messages { padding: 16px 20px 60px; }
  .gmsg { gap: 8px; }
  .gspeaker { max-width: 72px; font-size: 11px; padding: 1px 4px; }
  .gmsg-bubble { max-width: 78%; font-size: 13px; } /* v312：手机端角色的话字号缩小（原14px） */
  .group-inputbar { gap: 6px; padding: 8px 0 10px; }
  #group-input { font-size: 14px; }
  #btn-group-send { padding: 10px 16px; }
  /* v310手机端：立绘缩小到 4 人都在屏内（gp-4 80×4+gap 8×3=344px ✓）；气泡同步收窄防重叠 */
  body.group-stage-on .group-portraits.gp-2 .gp-img { width: 160px; height: 180px; }
  body.group-stage-on .group-portraits.gp-3 .gp-img { width: 110px; height: 130px; }
  body.group-stage-on .group-portraits.gp-4 .gp-img { width: 80px; height: 100px; }
  body.group-stage-on .group-portraits { gap: 8px; padding-bottom: 16px; }
  .gp-bubble { max-width: 80px; font-size: 12px; }
  #g-sm-player-bubble { left: 8%; width: 48%; bottom: 96px; font-size: 13px; }
}


/* ============================================================================
 * v319 宴会视觉增强：时段氛围 / 旁白分类 / 玩家回合提示 / 散场动画 / 时钟
 * 设计：和风旧纸 + 灯笼暖光。白天无夜晚效果；傍晚暖霞；夜晚灯笼光晕 + 萤火。
 * ============================================================================ */

/* ---------- 宴会时钟（顶栏右侧） ---------- */
#party-clock {
  flex-shrink: 0;
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
  font-size: 13px;
  color: #6b4a2b;
  background: rgba(255, 246, 228, .72);
  border: 1px solid rgba(143, 47, 33, .28);
  border-radius: 999px;
  padding: 3px 12px;
  letter-spacing: 1px;
  white-space: nowrap;
  transition: opacity .3s;
}
#party-clock.hidden { display: none; }

/* ---------- 时段氛围层（覆盖在 .group-stage 之上，不挡交互） ---------- */
.group-stage { position: relative; }
.group-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
/* 白天：极淡暖阳微光，无灯笼无萤火 */
body.party-period-day .group-stage::before {
  opacity: 1;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(255, 232, 180, .16), rgba(255, 244, 214, .05) 55%, transparent 80%);
}
/* 傍晚：暖霞色调，灯笼光晕 35% 透明度 */
body.party-period-evening .group-stage::before {
  opacity: 1;
  background:
    radial-gradient(ellipse 130% 90% at 50% 10%, rgba(255, 190, 120, .20), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 60%, rgba(179, 64, 47, .12), transparent 75%);
}
/* 夜晚：灯笼暖光全亮 + 萤火微粒层 */
body.party-period-night .group-stage::before {
  opacity: 1;
  background:
    radial-gradient(ellipse 120% 85% at 50% 5%, rgba(255, 190, 120, .28), transparent 68%),
    radial-gradient(ellipse 70% 55% at 50% 75%, rgba(179, 64, 47, .16), transparent 75%);
}
body.party-period-night .group-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(2px 2px at 12% 24%, rgba(255, 214, 140, .9), transparent 100%),
    radial-gradient(2.5px 2.5px at 68% 18%, rgba(255, 224, 160, .8), transparent 100%),
    radial-gradient(2px 2px at 84% 42%, rgba(255, 214, 140, .75), transparent 100%),
    radial-gradient(2px 2px at 30% 52%, rgba(255, 224, 160, .7), transparent 100%),
    radial-gradient(1.5px 1.5px at 52% 30%, rgba(255, 214, 140, .85), transparent 100%),
    radial-gradient(2px 2px at 92% 62%, rgba(255, 214, 140, .7), transparent 100%),
    radial-gradient(1.5px 1.5px at 8% 66%, rgba(255, 224, 160, .75), transparent 100%);
  animation: party-firefly 6s ease-in-out infinite alternate;
}
@keyframes party-firefly {
  from { transform: translateY(0); opacity: .8; }
  to   { transform: translateY(-14px); opacity: 1; }
}

/* 光晕叠加层：真实灯笼光晕纹理（黑底，screen 混合后黑色透明，只留暖光） */
body.party-period-night .group-stage .group-portraits::after,
body.party-period-evening .group-stage .group-portraits::after {
  content: '';
  position: absolute;
  left: 50%; top: 40%;
  width: 640px; max-width: 96vw;
  height: 640px;
  transform: translate(-50%, -50%);
  background: url('../assets/party-lantern-glow.webp') no-repeat center / 100% 100%;
  mix-blend-mode: screen;
  opacity: .5;
  pointer-events: none;
  z-index: 1;
}
body.party-period-evening .group-stage .group-portraits::after { opacity: .28; }

/* ---------- 旁白分类：时间流逝 / 氛围留白 / 散场 ---------- */
.gmsg.party-time .gmsg-bubble {
  color: #8f4a2a;
  font-style: normal;
  letter-spacing: 2px;
  font-size: 13px;
}
.gmsg.party-time .gmsg-bubble::before { content: '— '; opacity: .6; }
.gmsg.party-time .gmsg-bubble::after { content: ' —'; opacity: .6; }
.gmsg.party-ambient .gmsg-bubble {
  color: #a08a6d;
  font-style: italic;
  letter-spacing: 1px;
  font-size: 12px;
  opacity: .88;
}
.gmsg.party-end .gmsg-bubble {
  color: #8f2f21;
  font-style: normal;
  letter-spacing: 3px;
  font-size: 14px;
  font-weight: bold;
}

/* ---------- 气泡入场增强（v319：上浮 + 柔化） ---------- */
@keyframes g-fadeIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gmsg { animation: g-fadeIn .38s cubic-bezier(.22, .9, .3, 1); }
.gp-bubble, #g-sm-player-bubble, .g-stack-item {
  animation: g-fadeIn .35s cubic-bezier(.22, .9, .3, 1);
}
/* 流式呼吸：舞台气泡在流式更新中轻微脉动 */
body.group-stage-on .gp-bubble,
body.group-stage-on .g-stack-item {
  transition: box-shadow .5s, opacity .3s;
}
body.group-stage-on .gp-bubble:not(.hidden) {
  animation: party-breathe 2.4s ease-in-out infinite;
}
@keyframes party-breathe {
  0%, 100% { box-shadow: 0 3px 12px rgba(80, 55, 30, .18); }
  50%      { box-shadow: 0 3px 18px rgba(179, 64, 47, .30); }
}

/* ---------- 玩家回合提示（角色找玩家说话） ---------- */
body.party-player-turn .group-inputbar {
  animation: party-input-pulse 1.6s ease-in-out infinite;
}
@keyframes party-input-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(179, 64, 47, 0)); }
  50%      { filter: drop-shadow(0 0 10px rgba(179, 64, 47, .35)); }
}
body.party-player-turn #group-input {
  box-shadow: 0 0 0 2px rgba(179, 64, 47, .28);
}
body.party-player-turn #g-sm-player-bubble,
body.party-player-turn #sm-player-bubble {
  box-shadow: 0 3px 18px rgba(179, 64, 47, .35);
}

/* ---------- 散场收尾动画 ---------- */
.party-ending-mask {
  position: fixed;
  inset: 0;
  z-index: 1280;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 90% 70% at 50% 45%, rgba(60, 30, 15, .55), rgba(20, 10, 5, .82));
  animation: party-ending-in 1.2s ease forwards;
}
.party-ending-mask.fade-out { animation: party-ending-out .9s ease forwards; }
@keyframes party-ending-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes party-ending-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.party-ending-box {
  text-align: center;
  color: #f7eedd;
  letter-spacing: 6px;
}
.party-ending-title {
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
  font-size: 30px;
  margin-bottom: 10px;
  text-shadow: 0 0 24px rgba(255, 190, 120, .55);
}
.party-ending-sub {
  font-size: 14px;
  letter-spacing: 4px;
  color: #d8c4a0;
}

/* ---------- 发送按钮柔化（v319：朱红渐变 + 旧纸描边，不再抢视觉重心） ---------- */
#btn-group-send {
  background: linear-gradient(135deg, #8f2f21, #b3402f);
  border: 1px solid rgba(143, 47, 33, .45);
  box-shadow: 0 2px 6px rgba(143, 47, 33, .25);
}
#btn-group-send:hover { background: linear-gradient(135deg, #a5382a, #c44a36); }

/* ---------- 移动端：氛围层与光晕缩小 ---------- */
@media (max-width: 768px) {
  #party-clock { font-size: 11px; padding: 2px 8px; }
  body.party-period-night .group-stage .group-portraits::after,
  body.party-period-evening .group-stage .group-portraits::after {
    width: 340px; height: 340px; opacity: .4;
  }
  body.party-period-evening .group-stage .group-portraits::after { opacity: .22; }
  .party-ending-title { font-size: 24px; }
}


/* v319-2：舞台气泡名牌与分层（说话者识别） */
.gp-bubble { display: flex; flex-direction: column; gap: 2px; }
.gp-bubble-name {
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1.3;
}
.gp-bubble-text {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}
/* 舞台式叙述气泡（无说话者的系统旁白）与角色气泡区分 */
body.group-stage-on .gmsg.system .gmsg-bubble {
  background: rgba(255, 248, 232, .72);
  border: 1px dashed rgba(143, 47, 33, .22);
  border-radius: 8px;
  padding: 6px 14px;
  font-style: normal;
}
