/* 直播互动悬浮窗 —— 客户端窗口采集模式品红底 + 色键抠像；浏览器源模式透明 */

html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  user-select: none;
}

.hidden { display: none !important; }

/* ── 房间绑定 ───────────────────────────── */

.room-setup {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: inherit;
  z-index: 300;
}
.setup-card {
  width: 400px; padding: 34px 36px;
  background: rgba(17,20,28,.92);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.setup-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.setup-sub { font-size: 13px; color: #8b93a7; margin-bottom: 22px; }
.setup-input {
  width: 100%; padding: 12px 14px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07); color: #fff; font-size: 14px;
  outline: none; margin-bottom: 14px;
}
.setup-input:focus { border-color: #6a5cff; }
.setup-btn {
  width: 100%; padding: 12px;
  border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #6a5cff, #a04cff);
  color: #fff; font-size: 15px; font-weight: 700;
}
.setup-btn:disabled { opacity: .6; }
.setup-msg { margin-top: 12px; font-size: 13px; color: #ff9a9a; min-height: 18px; }

/* ── 工具条 ─────────────────────────────── */

.toolbar {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(17, 20, 28, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform .25s ease, opacity .25s ease;
}
.toolbar.collapsed { transform: translateX(-120%); opacity: 0; pointer-events: none; }
.toolbar-row { display: flex; align-items: center; gap: 6px; }
.toolbar-spacer { flex: 1; }
.toolbar-sep { width: 1px; height: 18px; background: rgba(255,255,255,.18); margin: 0 2px; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #666; flex: none; }
.status-dot.online { background: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.status-dot.connecting { background: #f1c40f; animation: pulse 1.2s infinite; }
.status-dot.offline, .status-dot.error { background: #e74c3c; }
@keyframes pulse { 50% { opacity: .35; } }

.anchor-name {
  color: #fff; font-size: 13px; font-weight: 600;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-btn {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #dde3ee; font-size: 13px; padding: 5px 12px;
  border-radius: 8px; cursor: pointer; transition: background .15s;
}
.tb-btn:hover { background: rgba(255,255,255,.2); }
.tb-btn:active { transform: scale(.96); }
.mode-btn.active {
  background: linear-gradient(135deg, #6a5cff, #a04cff);
  border-color: transparent; color: #fff; font-weight: 600;
}
.ctx-btn { background: rgba(94, 208, 148, .18); border-color: rgba(94,208,148,.4); color: #b8ecd0; }
.ctx-btn:hover { background: rgba(94, 208, 148, .35); }
.mode-hint { color: #8b93a7; font-size: 12px; }
.llm-pending { color: #f1c40f; font-size: 12px; margin-left: 8px; }

.toolbar-collapsed {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(17,20,28,.72); border: 1px solid rgba(255,255,255,.15);
  color: #cfd6e4; font-size: 16px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ── 转盘（老虎机）────────────────────────── */

#wheel-panel {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.wheel-wrap { position: relative; width: 380px; height: 380px; }
#wheel-svg { filter: drop-shadow(0 8px 30px rgba(0,0,0,.45)); }

.wheel-seg { stroke: rgba(10,12,20,.85); stroke-width: 2; transition: filter .1s; }
.wheel-seg.lit { filter: brightness(1.7) drop-shadow(0 0 14px #fff); }
.wheel-seg-label {
  fill: #fff; font-size: 17px; font-weight: 700;
  paint-order: stroke; stroke: rgba(0,0,0,.5); stroke-width: 3px;
  pointer-events: none;
}

.bulb {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  transform: translate(-50%, -50%);
  transition: background .08s, box-shadow .08s;
}
.bulb.on { background: #ffd76a; box-shadow: 0 0 12px #ffd76a; }

.wheel-hub {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 128px; height: 128px; border-radius: 50%;
  background: #14182b; border: 3px solid rgba(255,215,106,.7);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(0,0,0,.5);
  text-align: center; padding: 10px;
}
.hub-text { color: #ffd76a; font-size: 16px; font-weight: 800; line-height: 1.4; white-space: pre-line; }

.wheel-pointer {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  color: #ffd76a; font-size: 26px;
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
}
.wheel-meta {
  background: rgba(17,20,28,.72);
  border: 1px solid rgba(255,255,255,.12);
  color: #cfd6e4; font-size: 13px;
  padding: 6px 16px; border-radius: 20px;
}
.wheel-meta b { color: #ffd76a; }

.winner-banner {
  position: fixed; left: 50%; top: 20%;
  transform: translateX(-50%);
  padding: 18px 44px;
  background: linear-gradient(135deg, rgba(106,92,255,.92), rgba(217,79,143,.92));
  border-radius: 18px;
  color: #fff; font-size: 30px; font-weight: 800; text-align: center;
  box-shadow: 0 10px 44px rgba(140,60,255,.5);
  animation: winnerPop .5s cubic-bezier(.2,1.6,.4,1);
  z-index: 60;
}
@keyframes winnerPop { from { transform: translateX(-50%) scale(.3); opacity: 0; } }

/* ── 选店排行榜 ─────────────────────────── */

#shops-panel {
  position: fixed; right: 24px; top: 90px;
  width: 330px;
  display: flex; flex-direction: column; gap: 8px;
}
.shops-gate {
  padding: 30px 20px;
  background: rgba(17,20,28,.78);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.gate-btn {
  padding: 16px 52px; border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #2fbf9b, #1d9e8a);
  color: #fff; font-size: 20px; font-weight: 800;
  box-shadow: 0 8px 26px rgba(47,191,155,.4);
  animation: gatePulse 2s infinite;
}
@keyframes gatePulse { 50% { box-shadow: 0 8px 40px rgba(47,191,155,.75); } }
.gate-btn:active { transform: scale(.97); }
.gate-hint { color: #8b93a7; font-size: 13px; }

.shops-title {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 16px; font-weight: 700;
  padding: 8px 14px;
  background: rgba(17,20,28,.72);
  border-radius: 12px; border: 1px solid rgba(255,255,255,.12);
}
.phase-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 8px;
  background: rgba(255,255,255,.12); color: #b9c1d4;
}
.phase-badge.running { background: rgba(46,204,113,.25); color: #7df0ac; }
.phase-badge.finished { background: rgba(241,196,15,.25); color: #ffdd7a; }

.shops-list {
  list-style: none; margin: 0; padding: 6px;
  display: flex; flex-direction: column; gap: 6px;
  max-height: 480px; overflow: hidden;
}
.shop-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: rgba(17,20,28,.72);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  animation: rowIn .35s ease;
}
@keyframes rowIn { from { transform: translateY(-8px); opacity: 0; } }
.shop-row.flash { animation: flashHit 1s ease; }
@keyframes flashHit {
  0% { background: rgba(106,92,255,.85); border-color: #a04cff; }
  100% { background: rgba(17,20,28,.72); }
}
.shop-row .rank {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #39405a;
  background: rgba(255,255,255,.85);
}
.shop-row:nth-child(1) .rank { background: #ffd76a; }
.shop-row:nth-child(2) .rank { background: #d7dbe6; }
.shop-row:nth-child(3) .rank { background: #eba96b; }
.shop-row .name {
  flex: 1; color: #fff; font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shop-row .count { color: #9aa3ba; font-size: 13px; }
.shop-row .count b { color: #ffd76a; font-size: 17px; margin-right: 2px; }
.shop-row .row-ops { display: none; gap: 4px; }
.shop-row:hover .row-ops { display: flex; }
.shop-row .row-ops button {
  border: none; border-radius: 6px; cursor: pointer;
  font-size: 11px; padding: 3px 7px;
  background: rgba(255,255,255,.14); color: #dfe4ef;
}
.shop-row .row-ops button:hover { background: rgba(255,255,255,.3); }

.shops-empty {
  color: #7d86a0; font-size: 13px; text-align: center;
  padding: 18px 0;
  background: rgba(17,20,28,.55);
  border-radius: 12px;
}
.shops-winner {
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,175,64,.92), rgba(255,90,64,.92));
  color: #fff; font-size: 20px; font-weight: 800; text-align: center;
  animation: winnerPop .5s cubic-bezier(.2,1.6,.4,1);
}

/* ── Toast / 彩带 ───────────────────────── */

.toasts {
  position: fixed; bottom: 20px; right: 24px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
  z-index: 90;
}
.toast {
  background: rgba(17,20,28,.8);
  border: 1px solid rgba(255,255,255,.14);
  color: #e6eaf4; font-size: 13px;
  padding: 8px 14px; border-radius: 10px;
  animation: toastIn .25s ease, toastOut .4s ease 2.6s forwards;
}
.toast.gift { border-color: rgba(255,215,106,.65); }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(30px); opacity: 0; } }

.confetti {
  position: fixed; top: -12px; z-index: 200;
  width: 9px; height: 15px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .6; }
}
