/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --pink: #ff6fa5;
  --pink-deep: #ff4d8d;
  --rose: #ff9a9e;
  --lavender: #a18cd1;
  --ink: #3a2540;
  --ink-soft: #6b5570;
  --card-bg: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 50px rgba(214, 51, 108, 0.25);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  align-items: safe center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #ffd1dc 0%, #ffb6c1 25%, #fbc2eb 55%, #a18cd1 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  position: relative;
}

/* ===== 飘动爱心背景 ===== */
.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.hearts span {
  position: absolute;
  bottom: -40px;
  font-size: 26px;
  opacity: 0.5;
  animation: floatUp linear infinite;
  filter: drop-shadow(0 2px 4px rgba(255, 90, 140, 0.3));
}
.hearts span:nth-child(1) { left: 6%;  font-size: 22px; animation-duration: 16s; animation-delay: 0s; }
.hearts span:nth-child(2) { left: 20%; font-size: 30px; animation-duration: 20s; animation-delay: 3s; }
.hearts span:nth-child(3) { left: 35%; font-size: 18px; animation-duration: 14s; animation-delay: 6s; }
.hearts span:nth-child(4) { left: 50%; font-size: 28px; animation-duration: 22s; animation-delay: 1s; }
.hearts span:nth-child(5) { left: 64%; font-size: 24px; animation-duration: 18s; animation-delay: 8s; }
.hearts span:nth-child(6) { left: 76%; font-size: 20px; animation-duration: 15s; animation-delay: 4s; }
.hearts span:nth-child(7) { left: 86%; font-size: 32px; animation-duration: 24s; animation-delay: 2s; }
.hearts span:nth-child(8) { left: 94%; font-size: 22px; animation-duration: 17s; animation-delay: 7s; }

@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0; }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.35; }
  100% { transform: translateY(-110vh) rotate(40deg) scale(1.1); opacity: 0; }
}

/* ===== 主容器 ===== */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* ===== 标题 ===== */
.app__header { text-align: center; }
.title {
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ff4d8d, #a18cd1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 10px rgba(255, 77, 141, 0.15);
}
.subtitle { margin-top: 6px; color: var(--ink-soft); font-size: 15px; }

/* ===== 题目卡片 ===== */
.card {
  width: 100%;
  min-height: 240px;
  padding: 26px 24px;
  border-radius: 24px;
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card.pop { animation: pop 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.card.drawing .card__text { opacity: 0.65; }
.card.preview .card__text { color: var(--ink-soft); }

@keyframes pop {
  0%   { transform: scale(0.96); }
  50%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.card__top { display: flex; align-items: center; justify-content: space-between; }
.badge {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--lavender);
  box-shadow: 0 4px 10px rgba(161, 140, 209, 0.4);
}
.badge.c1 { background: #f0a830; box-shadow: 0 4px 10px rgba(240, 168, 48, 0.4); }  /* 回忆时光 */
.badge.c2 { background: #2bb6a3; box-shadow: 0 4px 10px rgba(43, 182, 163, 0.4); }   /* 关于你 */
.badge.c3 { background: #4a90d9; box-shadow: 0 4px 10px rgba(74, 144, 217, 0.4); }   /* 关于我们 */
.badge.c4 { background: #ff5fa2; box-shadow: 0 4px 10px rgba(255, 95, 162, 0.4); }   /* 甜蜜心动 */
.badge.c5 { background: #ff8a3d; box-shadow: 0 4px 10px rgba(255, 138, 61, 0.4); }   /* 趣味脑洞 */
.badge.c6 { background: #8e6fd1; box-shadow: 0 4px 10px rgba(142, 111, 209, 0.4); }  /* 灵魂深处 */
.badge.c7 { background: #5c6bc0; box-shadow: 0 4px 10px rgba(92, 107, 192, 0.4); }   /* 如果有一天 */
.badge.c8 { background: #e84393; box-shadow: 0 4px 10px rgba(232, 67, 147, 0.4); }   /* 大胆一点 */
.badge.c9 { background: #c77b4f; box-shadow: 0 4px 10px rgba(199, 123, 79, 0.4); }   /* 成长与原生家庭 */
.badge.c10 { background: #2a9d8f; box-shadow: 0 4px 10px rgba(42, 157, 143, 0.4); }  /* 伤痕与治愈 */
.badge.c11 { background: #ff7e6b; box-shadow: 0 4px 10px rgba(255, 126, 107, 0.4); } /* 真实的我 */
.badge.c12 { background: #4a5568; box-shadow: 0 4px 10px rgba(74, 85, 104, 0.4); }   /* 恐惧与软肋 */
.badge.c13 { background: #e63972; box-shadow: 0 4px 10px rgba(230, 57, 114, 0.4); }  /* 爱的本质 */
.badge.c14 { background: #5a7fd9; box-shadow: 0 4px 10px rgba(90, 127, 217, 0.4); }  /* 我们之间 */
.badge.c15 { background: #8e44ad; box-shadow: 0 4px 10px rgba(142, 68, 173, 0.4); }  /* 坦诚时刻 */
.badge.c16 { background: #c99700; box-shadow: 0 4px 10px rgba(201, 151, 0, 0.4); }   /* 价值与信仰 */
.badge.c17 { background: #6c7a89; box-shadow: 0 4px 10px rgba(108, 122, 137, 0.4); } /* 遗憾与告别 */
.badge.c18 { background: #3d3a8f; box-shadow: 0 4px 10px rgba(61, 58, 143, 0.4); }   /* 生命与远方 */

.number { font-size: 13px; color: var(--ink-soft); font-weight: 600; }

.card__text {
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1.6;
  font-weight: 600;
  text-align: center;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.card__hint { text-align: center; color: var(--ink-soft); font-size: 14px; }

/* ===== 剩余计数 ===== */
.remaining {
  font-size: 13px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  padding: 6px 14px;
  border-radius: 999px;
}

/* ===== 抽奖按钮 ===== */
.draw-btn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 44px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, #ff6fa5, #ff4d8d 55%, #a18cd1);
  box-shadow: 0 12px 28px rgba(255, 77, 141, 0.45);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: breathe 2.4s ease-in-out infinite;
  user-select: none;
}
.draw-btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.05); }
.draw-btn:active { transform: translateY(1px) scale(0.98); }
.draw-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.draw-btn[disabled] { cursor: wait; filter: saturate(0.7) brightness(0.95); animation: none; }
.draw-btn__icon { font-size: 22px; }

@keyframes breathe {
  0%, 100% { box-shadow: 0 12px 28px rgba(255, 77, 141, 0.45); }
  50%      { box-shadow: 0 16px 40px rgba(255, 77, 141, 0.65); }
}

/* ===== 工具栏 ===== */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tool {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}
.tool:hover { background: #fff; transform: translateY(-1px); }
.tool:active { transform: translateY(1px); }

/* ===== 开关 ===== */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.switch input { display: none; }
.switch__track {
  width: 42px; height: 24px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}
.switch__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--pink);
  transition: transform 0.2s ease, background 0.2s ease;
}
.switch input:checked + .switch__track { background: linear-gradient(135deg, #ff6fa5, #a18cd1); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(18px); background: #fff; }

/* ===== 页脚 ===== */
.app__footer { font-size: 12px; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; }
.dot { opacity: 0.5; }

/* ===== 提示 ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(58, 37, 64, 0.92);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 移动端适配 ===== */
/* 触控：去除点击高亮、消除双击缩放延迟 */
button, .switch, .tool { touch-action: manipulation; }

/* 平板及大屏手机以下：全宽大按钮 + 均分工具栏 + 紧凑布局 */
@media (max-width: 540px) {
  body { padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)); }
  .app { gap: 14px; max-width: 100%; }
  .title { letter-spacing: 1px; }
  .subtitle { font-size: 14px; }

  .card { min-height: 190px; padding: 22px 18px; border-radius: 20px; }
  .card__text { font-size: clamp(19px, 5.2vw, 24px); }

  .draw-btn {
    width: 100%;
    padding: 17px 24px;
    font-size: 19px;
    border-radius: 18px;
    animation: none;             /* 移动端关闭呼吸动画，省电、减少重绘 */
  }
  .draw-btn:active { transform: scale(0.98); }

  .toolbar { width: 100%; }
  .tool { flex: 1 1 auto; padding: 12px 8px; font-size: 13.5px; }

  .switch__text { font-size: 13px; }
  .app__footer { font-size: 11px; flex-wrap: wrap; justify-content: center; text-align: center; }
}

/* 小屏手机（≤360px）再收一档 */
@media (max-width: 360px) {
  .card { min-height: 170px; padding: 18px 14px; }
  .card__text { font-size: 18px; }
  .draw-btn { font-size: 18px; padding: 16px 20px; }
  .tool { font-size: 12.5px; padding: 11px 6px; }
}

/* 横屏手机：限制最大宽度，避免按钮被拉得过宽 */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .app { max-width: 480px; }
  .card { min-height: 150px; }
  .hearts span { font-size: 18px; }
}

/* ===== 开场：输入用户名 ===== */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
  background: linear-gradient(135deg, #ffd1dc 0%, #ffb6c1 25%, #fbc2eb 55%, #a18cd1 100%);
  background-attachment: fixed;
  animation: fadeIn 0.4s ease both;
}
.gate.hidden, html.has-name .gate { display: none; }
.gate.shake { animation: shake 0.42s; }
.gate__box {
  width: 100%;
  max-width: 380px;
  padding: 34px 26px;
  text-align: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  box-shadow: var(--shadow);
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gate__heart { font-size: 52px; line-height: 1; animation: beat 1.6s ease-in-out infinite; }
.gate__title {
  margin: 12px 0 4px;
  font-size: 26px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(90deg, #ff4d8d, #a18cd1);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gate__desc { color: var(--ink-soft); font-size: 15px; margin-bottom: 18px; }
.gate__input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;                /* ≥16px，避免 iOS 聚焦自动放大 */
  color: var(--ink);
  text-align: center;
  border: 2px solid rgba(255, 120, 170, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gate__input:focus { border-color: var(--pink-deep); box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.15); }
.gate__input::placeholder { color: #c9a9b8; }
.gate__btn {
  margin-top: 14px;
  width: 100%;
  padding: 15px;
  font-size: 17px; font-weight: 800; letter-spacing: 1px;
  color: #fff; border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #ff6fa5, #ff4d8d 55%, #a18cd1);
  box-shadow: 0 10px 24px rgba(255, 77, 141, 0.4);
  transition: transform 0.12s ease, filter 0.2s ease;
}
.gate__btn:active { transform: scale(0.98); }
.gate__hint { margin-top: 14px; color: var(--ink-soft); font-size: 12.5px; }

/* ===== 抽奖页：显示用户名 ===== */
.who { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; }
.who__chip {
  display: inline-flex; align-items: center;
  padding: 5px 14px;
  font-size: 14px; font-weight: 700; color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6fa5, #a18cd1);
  box-shadow: 0 4px 12px rgba(255, 77, 141, 0.35);
}
.who__chip::before { content: "👤 "; }
.who__edit {
  font-size: 13px; line-height: 1;
  width: 28px; height: 28px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}
.who__edit:hover { background: #fff; transform: rotate(-12deg); }
.who__edit:active { transform: scale(0.9); }
#greeting b { color: var(--pink-deep); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

@media (max-width: 540px) {
  .gate__box { padding: 28px 20px; }
  .gate__title { font-size: 23px; }
  .gate__heart { font-size: 46px; }
  .who__chip { font-size: 13px; padding: 5px 12px; }
}

/* ===== 抽奖记录面板 ===== */
.record {
  width: 100%;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(214, 51, 108, 0.12);
  overflow: hidden;
}
.record__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 120, 170, 0.18);
}
.record__title { font-size: 14px; font-weight: 700; color: var(--ink); }
.record__count {
  display: inline-block; min-width: 18px; text-align: center;
  padding: 1px 8px; font-size: 12px; color: #fff;
  background: linear-gradient(135deg, #ff6fa5, #a18cd1);
  border-radius: 999px; margin-left: 4px;
}
.record__clear {
  font-size: 12.5px; color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 120, 170, 0.25);
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.record__clear:hover { background: #fff; color: var(--pink-deep); }
.record__list {
  list-style: none; margin: 0; padding: 6px;
  max-height: 260px; overflow-y: auto;
}
.record__list::-webkit-scrollbar { width: 6px; }
.record__list::-webkit-scrollbar-thumb { background: rgba(255, 120, 170, 0.4); border-radius: 3px; }
.record__empty { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 18px 0; }
.record__item {
  padding: 10px 12px; margin-bottom: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 120, 170, 0.12);
  animation: rise 0.35s ease both;
}
.record__item:last-child { margin-bottom: 0; }
.record__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.record__name { font-size: 13.5px; font-weight: 700; color: var(--pink-deep); white-space: nowrap; }
.record__meta { font-size: 11.5px; color: var(--ink-soft); }
.record__q { font-size: 14px; line-height: 1.5; color: var(--ink); }

@media (max-width: 540px) {
  .record__list { max-height: 220px; }
  .record__meta { font-size: 11px; }
}

/* ===== 计分板（双玩家） ===== */
.scoreboard { width: 100%; display: flex; gap: 10px; margin-top: 12px; }
.player {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid transparent;
  cursor: pointer; position: relative;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.player:hover { transform: translateY(-2px); }
.player.is-turn {
  border-color: var(--pink-deep);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(255, 77, 141, 0.25);
}
.player__avatar { font-size: 30px; line-height: 1; }
.player__info { min-width: 0; flex: 1; }
.player__name { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__score { font-size: 12px; color: var(--ink-soft); }
.player__score b { color: var(--pink-deep); font-size: 14px; }
.player__tag {
  position: absolute; top: -8px; right: 8px;
  font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, #ff6fa5, #a18cd1);
  padding: 2px 8px; border-radius: 999px;
}
.header-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }
.hdr-btn {
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
}
.hdr-btn:hover { background: #fff; transform: translateY(-1px); }
.hdr-btn.danger:hover { color: #d33; }

/* ===== 卡片：轮次 / 回答区 / 操作按钮 ===== */
.card__turn { text-align: center; font-size: 14px; font-weight: 700; color: var(--pink-deep); }
.rating { width: 100%; text-align: center; }
.rating__by { font-size: 14px; font-weight: 700; color: var(--pink-deep); margin-bottom: 8px; }
.rating__stars { display: flex; justify-content: center; gap: 4px; }
.star {
  font-size: 34px; line-height: 1; padding: 2px 4px;
  background: none; border: none; cursor: pointer;
  color: #e3c4d2; transition: transform 0.1s ease, color 0.15s ease;
}
.star:hover { transform: scale(1.15); }
.star.on { color: #ffb300; text-shadow: 0 2px 6px rgba(255, 179, 0, 0.5); }
.rating__hint { font-size: 13px; color: var(--ink-soft); margin-top: 6px; min-height: 18px; }
.card__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.act {
  flex: 1 1 auto; padding: 12px 14px; font-size: 14px; font-weight: 700;
  border: none; border-radius: 14px; cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease;
}
.act:active { transform: scale(0.98); }
.act--primary { color: #fff; background: linear-gradient(135deg, #ff6fa5, #ff4d8d 55%, #a18cd1); box-shadow: 0 8px 20px rgba(255, 77, 141, 0.35); }
.act--ghost { color: var(--ink); background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 120, 170, 0.3); }

/* ===== 开场：双玩家 + 头像选择 ===== */
.players { display: flex; gap: 12px; margin: 8px 0 16px; }
.psetup {
  flex: 1 1 0; min-width: 0;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 120, 170, 0.25);
  border-radius: 16px; padding: 14px 10px;
}
.psetup__avatar { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.psetup__name {
  width: 100%; text-align: center; padding: 9px 8px; font-size: 15px;
  color: var(--ink); border: 2px solid rgba(255, 120, 170, 0.3); border-radius: 12px;
  background: rgba(255, 255, 255, 0.85); outline: none; margin-bottom: 8px;
}
.psetup__name:focus { border-color: var(--pink-deep); }
.avatar-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-height: 96px; overflow-y: auto; }
.avatar-chip {
  width: 30px; height: 30px; font-size: 18px; line-height: 30px; padding: 0;
  border: 2px solid transparent; border-radius: 8px; background: rgba(255, 255, 255, 0.6);
  cursor: pointer; transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}
.avatar-chip:hover { background: #fff; transform: scale(1.1); }
.avatar-chip.selected { border-color: var(--pink-deep); background: #fff; transform: scale(1.05); }

/* ===== 真心话册 弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(58, 37, 64, 0.45); backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}
.modal[hidden] { display: none; }
.modal__box {
  width: 100%; max-width: 520px; max-height: 86vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; box-shadow: 0 24px 60px rgba(58, 37, 64, 0.4);
  overflow: hidden; animation: rise 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #f0e0e8; }
.modal__title { font-size: 16px; font-weight: 800; color: var(--ink); }
.modal__close { width: 30px; height: 30px; font-size: 16px; border: none; border-radius: 50%; background: #f6eaf0; color: var(--ink-soft); cursor: pointer; }
.modal__close:hover { background: #f0d8e4; color: var(--pink-deep); }
.modal__body { padding: 12px 16px; overflow-y: auto; }
.modal__foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #f0e0e8; flex-wrap: wrap; }
.modal__foot .hdr-btn { flex: 1 1 auto; text-align: center; }
.book__empty { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 30px 10px; line-height: 1.7; }
.book__item { padding: 12px 0; border-bottom: 1px dashed #f0d8e4; }
.book__item:last-child { border-bottom: none; }
.book__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.book__who { font-size: 14px; font-weight: 700; color: var(--pink-deep); }
.book__date { font-size: 11.5px; color: var(--ink-soft); }
.book__q { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 4px; }
.book__stars { font-size: 15px; color: #ffb300; letter-spacing: 1px; white-space: nowrap; }
.book__stars b { color: var(--pink-deep); font-size: 13px; }
.book__rate { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 4px; }

@media (max-width: 540px) {
  .players { flex-direction: column; }
  .player__avatar { font-size: 26px; }
  .player__name { font-size: 14px; }
  .modal__box { max-height: 90vh; }
  .header-actions .hdr-btn { padding: 8px 10px; font-size: 12.5px; }
}

/* ===== 联机大厅 ===== */
body:not(.in-game) .app { display: none; }     /* 未进入游戏时隐藏游戏界面 */
body.in-game #lobby { display: none; }          /* 进入游戏后隐藏大厅 */

.tabs { display: flex; gap: 8px; margin: 6px 0 14px; }
.tab {
  flex: 1; padding: 9px; font-size: 14px; font-weight: 700;
  color: var(--ink-soft); cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 120, 170, 0.25);
  border-radius: 12px; transition: all 0.2s ease;
}
.tab.is-active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #ff6fa5, #a18cd1);
}
.field { margin-top: 10px; }
.created { margin-top: 16px; }
.created__label { font-size: 13px; color: var(--ink-soft); margin-bottom: 2px; }
.created__code {
  font-size: 32px; font-weight: 800; letter-spacing: 5px;
  color: var(--pink-deep); margin: 2px 0 12px;
}
.created__wait { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
