/* ==========================================================
   v2.1 S5 · 房间页样式
   风格：Sonoma 毛玻璃 + 高饱和模块色 + 24px 卡间距 + 20px 圆角
   ========================================================== */
.room-body {
  background: linear-gradient(165deg, #eef1f8 0%, #f7f2f0 55%, #f3eef8 100%);
}

/* ---- LV4+ 梦幻糖果主题：自动应用（FR-S5.6 exclusive_themes） ---- */
html.has-candy-theme body.room-body {
  background: linear-gradient(135deg, #ffe7f1 0%, #ffe1d8 35%, #e4e0ff 75%, #d8efff 100%);
}
html.has-candy-theme :root {
  --accent: #e8559a;
  --accent2: #ff8f6b;
  --glow: rgba(232, 85, 154, 0.35);
}
html.has-candy-theme .glass {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 24px 56px rgba(232, 85, 154, 0.10),
    0 6px 18px rgba(95, 124, 255, 0.09);
}
html.has-candy-theme .blob-1 { background: #ffc7e1; }
html.has-candy-theme .blob-2 { background: #d9d2ff; }
html.has-candy-theme .blob-3 { background: #ffe0c8; }
html.has-candy-theme .pill,
html.has-candy-theme .badge-soft { color: #7b2a55; }
html.has-candy-theme .cta {
  background: linear-gradient(135deg, #ff8ab8, #ff9966 60%, #b79dff);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.1);
}

/* ---- Layout ---- */
.room-app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 36px;
  position: relative;
  z-index: 1;
}
.room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.room-top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.back-btn {
  width: 40px; height: 40px; border-radius: 14px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.7);
  display: grid; place-items: center;
  color: var(--text);
}
.back-btn:hover { background: #fff; }
.room-title h1 { font-size: 20px; font-weight: 900; letter-spacing: 1px; margin: 0; }
.room-title .room-desc {
  font-size: 12.5px; color: var(--muted);
  max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}
.room-top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #3a3e58;
  box-shadow: 0 4px 10px rgba(35,42,80,.04);
}
.pill b { font-weight: 900; letter-spacing: 2px; color: var(--accent); }
.pill .label { color: var(--muted); font-size: 11px; letter-spacing: 0; }
.copy-btn {
  padding: 3px 10px !important;
  font-size: 11px !important;
  min-height: 0 !important;
}
.level-pill {
  background: linear-gradient(135deg, rgba(255,190,92,.18), rgba(183,157,255,.16));
  color: #6a4b00;
  border: 1px solid rgba(255,190,92,.35);
}
.sync-pill.on { background: #d8f6e1; color: #1f7a42; }
.sync-pill { font-weight: 700; }

/* Room 三栏网格（左中右） */
.room-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1024px) {
  .room-grid {
    grid-template-columns: 1fr;
  }
}

/* 通用卡片头 */
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-head h2 {
  font-size: 15px; font-weight: 800; letter-spacing: 0.5px;
}
.badge-soft {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: rgba(138, 143, 163, 0.1);
  padding: 4px 10px; border-radius: 999px;
}
.badge-soft[data-role="owner"]  { background: #fff3d0; color: #8a5b00; }
.badge-soft[data-role="admin"]  { background: #d6e8ff; color: #184f94; }
.badge-soft[data-role="member"] { background: #d9f4dd; color: #266a38; }
.badge-soft[data-role="guest"]  { background: #ececf1; color: #6b7085; }

.members-card, .events-card, .room-wheel-card { padding: 18px; }

/* ---- 成员列表 ---- */
.members-list {
  list-style: none; padding: 0; margin: 0 0 14px;
  display: flex; flex-direction: column; gap: 6px;
  max-height: 62vh; overflow-y: auto;
}
.member-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 14px;
  background: rgba(255,255,255,.4);
  cursor: default;
  transition: background .15s ease, transform .12s ease;
}
.member-item.clickable { cursor: pointer; }
.member-item.clickable:hover { background: rgba(255,255,255,.7); transform: translateY(-1px); }
.member-item.offline .avatar-wrap::after { background: #c0c4d3 !important; }
.member-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd6ec, #d3dcff);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #6f529c;
  position: relative;
  flex-shrink: 0;
}
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-wrap::after {
  content: ""; position: absolute;
  right: -2px; bottom: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #35c776;
  border: 2px solid #fff;
}
.member-body { min-width: 0; flex: 1; }
.member-name {
  font-size: 13.5px; font-weight: 700;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.role-tag {
  font-size: 10.5px; font-weight: 800; padding: 1.5px 6px; border-radius: 8px;
  letter-spacing: 0.3px;
}
.role-tag.owner  { background: #ffe9b0; color: #834e00; }
.role-tag.admin  { background: #cfe2ff; color: #144e99; }
.role-tag.member { background: #cdeed4; color: #1f6a35; }
.role-tag.guest  { background: #ececf1; color: #6b7085; }
.role-tag.banned { background: #ffd9d9; color: #8a1d1d; }
.member-sub { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; }
.lv-chip {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  color: #6a4b00; background: rgba(255,190,92,.22);
  padding: 1px 7px; border-radius: 8px;
}

.members-actions {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px dashed rgba(138,143,163,.18);
  padding-top: 12px;
}

/* ---- 转盘区 ---- */
.room-wheel-card { text-align: center; }
.room-wheel-card .wheel-wrap { margin: 10px auto; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.go-tooltip {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.7); color: #fff; font-size: 11px;
  padding: 3px 10px; border-radius: 10px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .15s ease;
}
.idle[disabled]:hover + .go-tooltip,
#goBtn[disabled]:hover ~ .go-tooltip { opacity: 1; }

/* ---- 事件日志 ---- */
.events-list {
  list-style: none; padding: 0; margin: 0;
  max-height: 62vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.event-item {
  padding: 9px 12px; border-radius: 14px;
  background: rgba(255,255,255,.42);
  font-size: 12.5px; color: var(--text);
  border-left: 3px solid var(--stroke);
}
.event-item[data-kind="start-spin"]   { border-left-color: #ffb35e; }
.event-item[data-kind="stop-spin"]    { border-left-color: #ff8f6b; }
.event-item[data-kind="resolve"]      { border-left-color: #35c776; background: rgba(216, 246, 225, .5); }
.event-item[data-kind="join"]         { border-left-color: #5f7cff; }
.event-item[data-kind="leave"]        { border-left-color: #b1b6c8; }
.event-item[data-kind="kick"]         { border-left-color: #ff7878; }
.event-item[data-kind="ban"]          { border-left-color: #d12a2a; background: rgba(255, 217, 217, .35); }
.event-item[data-kind="role_change"]  { border-left-color: #a255e8; }
.event-item[data-kind="wheel_change"] { border-left-color: #1fa2c9; }
.event-item .time { color: var(--muted); font-size: 10.5px; margin-right: 6px; }
.event-item b { color: var(--accent); }

/* ---- 4 位码输入 ---- */
.code-inputs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin: 12px 0 6px;
}
.code-inputs input {
  width: 100%; aspect-ratio: 1/1; text-align: center;
  font-size: 28px; font-weight: 900; letter-spacing: 0;
  border-radius: 16px;
  border: 2px solid rgba(138, 143, 163, .18);
  background: rgba(255,255,255,.5);
  color: var(--text); outline: none;
  transition: border-color .15s ease, transform .1s ease;
}
.code-inputs input:focus {
  border-color: var(--accent); background: #fff; transform: translateY(-1px);
}

/* ---- 成员菜单 ---- */
.modal.narrow { max-width: 300px; }
.member-menu-actions {
  display: flex; flex-direction: column; gap: 10px; margin-top: 8px;
}
.member-menu-actions .mini-btn { width: 100%; }

/* ---- CTA / mini-btn 补充（home.php style 中 mini-btn 可能缺失，兜底） ---- */
.mini-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px; min-height: 32px;
  font-size: 12.5px; font-weight: 700;
  border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.85); color: var(--text);
  transition: transform .12s ease, background .15s ease;
}
.mini-btn:hover { background: #fff; transform: translateY(-1px); }
.mini-btn:active { transform: scale(.97); }
.mini-btn.ghost { background: transparent; border-color: rgba(138, 143, 163, .25); }
.mini-btn.warn { background: #fff2cf; color: #6a4800; border-color: rgba(255, 200, 80, .45); }
.mini-btn.danger { background: #ffdede; color: #8a1d1d; border-color: rgba(255, 120, 120, .45); }
.mini-btn[hidden] { display: none !important; }

.link { color: var(--accent); text-decoration: none; font-weight: 700; }
.link:hover { text-decoration: underline; }

/* 转盘禁用 GO 覆盖 */
#goBtn[disabled] {
  filter: grayscale(0.35) opacity(.8);
  cursor: not-allowed;
}
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }
