/* 糖人杀 M3 · 界面样式（糖果配色，零外链，全部系统字体；M1/M2 样式全部保留） */

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

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  /* 糖果条纹背景：用 CSS 画的，不用任何图片 */
  background: repeating-linear-gradient(
    -45deg, #ffe3ec 0 24px, #fff7f0 24px 48px);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #4a2b3a;
}

.card {
  width: 360px;
  max-width: 100%;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(255, 92, 138, .25);
  padding: 28px 26px;
  text-align: center;
}

h1 { font-size: 34px; letter-spacing: 4px; color: #ff5c8a; }
.candy {
  display: inline-block;
  background: #ff5c8a;
  color: #fff;
  border-radius: 50%;
  width: 46px; height: 46px; line-height: 46px;
  margin-right: 6px;
  font-size: 26px;
}
.subtitle { font-size: 13px; color: #b78ea0; margin: 8px 0 20px; }

/* ---- 表单 ---- */
label { display: block; text-align: left; font-size: 14px; margin-bottom: 6px; }

input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 2px solid #ffd0de;
  border-radius: 10px;
  outline: none;
  background: #fffafb;
}
input:focus { border-color: #ff5c8a; }

.btn {
  width: 100%;
  margin-top: 12px;
  padding: 11px 0;
  font-size: 16px;
  border: 2px solid #ff5c8a;
  border-radius: 10px;
  background: #fff;
  color: #ff5c8a;
  cursor: pointer;
  transition: transform .05s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: #ff5c8a; color: #fff; }
.btn.primary:hover { background: #ff7ba1; }
.btn.ghost { border-color: #e3b7c6; color: #b78ea0; width: auto; padding: 8px 24px; }

.join-row { display: flex; gap: 10px; margin-top: 12px; }
.join-row .code-input {
  flex: 1;
  text-align: center;
  letter-spacing: 6px;
  text-transform: uppercase;
  font-size: 18px;
}
.join-row .btn { width: 42%; margin-top: 0; }

/* ---- 房间视图 ---- */
.hidden { display: none; }

.hint { font-size: 13px; color: #b78ea0; margin-top: 6px; }

.room-code-big {
  font-size: 40px;
  letter-spacing: 10px;
  color: #ff5c8a;
  background: #fff0f5;
  border: 3px dashed #ff9ab6;
  border-radius: 12px;
  padding: 8px 0;
  margin: 8px 0 14px;
  user-select: all;      /* 方便点击选中复制房间号 */
}

.members {
  list-style: none;
  text-align: left;
  margin: 6px 0 12px;
}
.members li {
  background: #fff0f5;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 15px;
}
.members li::before { content: "🍬 "; }

.msg { min-height: 20px; font-size: 13px; color: #e0526e; margin-top: 8px; }
.online { font-size: 13px; color: #b78ea0; margin-top: 10px; }
.note { font-size: 12px; color: #c9a5b4; margin-top: 14px; }

.conn {
  margin-top: 16px;
  font-size: 12px;
  color: #7fbf7f;
}
.conn.bad { color: #e0526e; }

/* ==================== M2 对局界面 ==================== */

/* 名单里的出局玩家：划掉 + 变淡 */
.members li.dead { opacity: .45; text-decoration: line-through; }
.members li .dead-tag { text-decoration: none; font-size: 12px; }

/* 身份卡：开局私信发来的身份，只有自己看得到 */
.role-card {
  background: #fff0f5;
  border: 2px solid #ffd0de;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.role-label { font-size: 12px; color: #b78ea0; }
.role-name { font-size: 24px; font-weight: bold; margin: 4px 0; }
.role-name.wolf     { color: #e0526e; }   /* 狼人：红 */
.role-name.seer     { color: #7b6cf6; }   /* 预言家：紫 */
.role-name.villager { color: #3fa66d; }   /* 平民：绿 */
.role-desc { font-size: 12px; color: #8d6b7d; line-height: 1.5; }
.role-mates { font-size: 12px; color: #e0526e; margin-top: 4px; }

/* 阶段横幅：深夜底色 + 浅粉字，一眼看清现在是什么阶段 */
.phase-banner {
  margin-top: 12px;
  padding: 8px 10px;
  background: #3b2a3f;
  color: #ffe3ec;
  border-radius: 10px;
  font-size: 14px;
}

/* 行动区：放目标按钮 / 发言输入框 / 等待提示 */
#action-area { min-height: 34px; margin-top: 10px; }
.waiting { font-size: 13px; color: #b78ea0; }
.target-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.target-btn {
  padding: 8px 14px;
  border: 2px solid #ff9ab6;
  background: #fff;
  color: #e0526e;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: transform .05s, background .15s;
}
.target-btn:active { transform: scale(.95); }
.target-btn:hover { background: #fff0f5; }

/* 轮到自己发言时的输入框一行 */
.speak-box { display: flex; gap: 8px; }
.speak-box input { flex: 1; }
.speak-box .btn { width: auto; padding: 8px 14px; margin-top: 0; font-size: 14px; }

/* 公共记录：死讯 / 发言 / 投票结果按顺序滚在这里 */
.log {
  margin-top: 12px;
  max-height: 180px;
  overflow-y: auto;
  text-align: left;
  background: #fffafb;
  border: 1px solid #ffd0de;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.log p { margin: 4px 0; line-height: 1.5; }
.log .sys { color: #b06fa0; text-align: center; }
.log .say b { color: #ff5c8a; margin-right: 2px; }
.log .secret { color: #7b6cf6; }

/* 胜负弹窗：半透明黑底盖全屏，中间一张白卡片 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(59, 42, 63, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
}
.modal.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 300px;
  max-width: 92%;
  text-align: center;
}
.winner-text { font-size: 22px; font-weight: bold; color: #ff5c8a; margin-bottom: 12px; }
.roles-reveal { list-style: none; text-align: left; margin-bottom: 14px; font-size: 14px; }
.roles-reveal li { padding: 4px 0; border-bottom: 1px dashed #ffd0de; }

/* ==================== M3 完整版角色 ==================== */

/* 房主开局前的角色勾选框（不勾 = M2 简化版） */
.game-options {
  margin-top: 12px;
  text-align: left;
  background: #fff0f5;
  border: 1px solid #ffd0de;
  border-radius: 10px;
  padding: 10px 12px;
}
.game-options .opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 4px 0;
  cursor: pointer;
}
.game-options .opt input { width: 16px; }
.game-options .opt-sub {   /* 女巫自救开关：缩进一格，表示从属于女巫 */
  margin-left: 22px;
  font-size: 13px;
  color: #8d6b7d;
}

/* 新身份的身份卡配色 */
.role-name.witch  { color: #b06fa0; }   /* 女巫：莓紫 */
.role-name.hunter { color: #d9822b; }   /* 猎人：橙 */

/* 女巫"不用药"/ 猎人"不开枪"这类放弃按钮：窄一点，不抢主按钮的视觉 */
.skip-btn {
  width: auto;
  padding: 8px 20px;
  margin: 10px auto 0;
  font-size: 14px;
}

/* ==================== M4 展示版 v1.0 ==================== */

/* 首页规则注脚里的攻略页入口（M4 可选加分项：静态攻略占位页） */
.guide-link { color: #ff5c8a; text-decoration: none; }
.guide-link:hover { text-decoration: underline; }
