/* 3D 抽奖球 UI（iframe + inline）统一样式源
 *
 * 说明：
 * - iframe 页面：`client/lottery-3d.html`（html.lottery-3d-page）
 * - inline 容器：`.lottery-3d-inline`（主站/桌台微信模式）
 * - 结果弹窗：`.lottery-result-overlay` 等（两种模式共用）
 */

/* ===== iframe 页面：整页透明 + 全屏 canvas ===== */
html.lottery-3d-page,
html.lottery-3d-page body {
  margin: 0;
  padding: 0;
  background: transparent !important;
  background-color: transparent !important;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

html.lottery-3d-page canvas#lottery-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  background: transparent !important;
  background-color: transparent !important;
}

/* ===== iframe 宿主：抽奖 3D 球 iframe（主站 index / 桌台 / overlay 使用） ===== */
.lottery-3d-iframe {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  pointer-events: none !important;
  /* 叠层：放到历史区上方（用户需要球覆盖历史），但仍低于飘动弹幕层与输入区 */
  z-index: 100 !important;
  background: transparent !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: none;
}

.lottery-3d-iframe.is-visible {
  display: block;
}

/* ===== 微信 inline：提供同页 3D 球渲染容器 ===== */
.lottery-3d-inline {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 100 !important;
  background: transparent !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: none;
}

.lottery-3d-inline.is-visible {
  display: block;
}

.lottery-3d-inline canvas#lottery-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  background: transparent !important;
}

/* ===== 开奖倒计时（收集中显示，开奖/停止后隐藏） ===== */
.lottery-countdown {
  position: fixed;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 8;
  pointer-events: none;
}

.lottery-countdown.show {
  opacity: 1;
  visibility: visible;
}

.lottery-countdown-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
}

.lottery-countdown-time {
  font-size: 26px;
  font-weight: 800;
  color: #ffd700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

/* ===== 结果展示（自动显示/自动隐藏；宿主 iframe 通常 pointer-events:none，所以不依赖点击关闭） ===== */
.lottery-result-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 10;
  pointer-events: none;
}

.lottery-result-overlay.show {
  opacity: 1;
  visibility: visible;
}

.lottery-result-modal {
  width: min(560px, 92vw);
  border-radius: 18px;
  padding: 22px 20px;
  background: linear-gradient(135deg, rgba(50, 110, 220, 0.9), rgba(120, 70, 180, 0.9));
  border: 2px solid rgba(255, 215, 0, 0.7);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  text-align: center;
}

.lottery-result-title {
  margin: 0 0 12px 0;
  font-size: 22px;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.lottery-result-prize {
  display: none;
}

.lottery-winners {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  text-align: left;
}

.lottery-winner-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
}

.lottery-winner-name {
  font-weight: 800;
  color: #ffd700;
  margin: 0 0 4px 0;
  font-size: 16px;
}

.lottery-winner-content {
  margin: 0;
  font-size: 14px;
  opacity: 0.95;
  word-break: break-word;
}


