/* ==========================================================================
   活动抽奖系统 - Clean & Joyful Modern Event UI
   ========================================================================== */

/* 1. Global Reset & Tokens */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Global Premium Scrollbar (Finesse UI)
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.8);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

:root {
  /* Clean Light Theme Substrate */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  
  /* Precise Accents (Festive Red & Gold) */
  --accent-primary: #ef4444; /* Vivid Red */
  --accent-primary-hover: #dc2626;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fef3c7;
  --accent-blue: #3b82f6;
  --god-rays-color: rgba(253, 230, 138, 0.15); /* Soft gold for modal background */
  
  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  /* Borders & Shadows */
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body.craft-body {
  font-family: var(--font-family);
  background: var(--bg-body);
  /* A very soft, clean background pattern to break the emptiness but keep it light */
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Hide Canvas Particles */
#particle-canvas {
  display: none !important;
}

/* Global Hidden Rule */
.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ==========================================================================
   2. Navbar (Clean Header)
   ========================================================================== */
.craft-navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logotype {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-logotype small {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-left: 6px;
  background: #fee2e2;
  padding: 4px 8px;
  border-radius: 6px;
}

.brand-status-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
  background: #dbeafe;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Sequence Navigation Container (流程灯轨) - Cleaned up */
.sequence-nav-container {
  flex: 1;
  max-width: 620px;
  margin: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sequence-flex-list {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 30px;
  overflow-x: auto;
}

.seq-item-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.seq-item-tag.clickable:hover {
  background: var(--bg-surface);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.seq-item-tag.active {
  background: var(--bg-surface);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.seq-item-tag.done {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Nav Action Buttons */
.nav-action-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-craft-icon, .btn-craft-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  box-shadow: var(--shadow-sm);
}

.btn-craft-icon:hover, .btn-craft-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-craft-outline.gold {
  border-color: #fde68a;
  color: var(--accent-gold);
  background: #fffbeb;
}
.btn-craft-outline.gold:hover {
  background: #fef3c7;
}

/* ==========================================================================
   3. Mystery Stage & CSS 3D Blind Box Engine
   ========================================================================== */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes boxShakePhysical {
  0%, 100% { transform: rotateX(-15deg) rotateY(45deg); }
  25% { transform: rotateX(-15deg) rotateY(45deg) rotateZ(3deg) translateX(-2px); }
  75% { transform: rotateX(-15deg) rotateY(45deg) rotateZ(-3deg) translateX(2px); }
}

@keyframes lidPopPhysical {
  0% { transform: translate3d(0, 0, 0) rotateX(0) rotateY(0) rotateZ(0); opacity: 1; }
  100% { transform: translate3d(60px, -120px, 80px) rotateX(60deg) rotateY(45deg) rotateZ(30deg); opacity: 0; }
}

/* 四面墙壁向外展开铺平的动画 */
@keyframes unfoldFront {
  100% { transform: translateZ(80px) rotateX(90deg); opacity: 0; }
}
@keyframes unfoldBack {
  100% { transform: rotateY(180deg) translateZ(80px) rotateX(90deg); opacity: 0; }
}
@keyframes unfoldLeft {
  100% { transform: rotateY(-90deg) translateZ(80px) rotateX(90deg); opacity: 0; }
}
@keyframes unfoldRight {
  100% { transform: rotateY(90deg) translateZ(80px) rotateX(90deg); opacity: 0; }
}

@keyframes glowBurstPhysical {
  0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(25); opacity: 0; }
}

@keyframes prizePopOut {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: translate(-50%, -60%) scale(1.2) rotate(10deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
}

/* 核心布局类 (修复UI变形) */
.craft-stage {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.stage-center-vault {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 600px;
}

.mystery-stage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.mystery-prize-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  padding: 24px 48px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.deck-rarity-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-primary);
  background: #fee2e2;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: livePulse 2s infinite;
}

/* 核心交互盲盒 3D 引擎 */
.blind-box-element {
  position: relative;
  width: 260px;
  height: 260px;
  cursor: pointer;
  animation: floatY 4s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  z-index: 10;
  -webkit-font-smoothing: antialiased;
}

.box-3d-scene {
  position: relative;
  width: 160px;
  height: 160px;
  transform-style: preserve-3d;
  transform: rotateX(-15deg) rotateY(45deg);
  transition: transform 0.5s ease;
  will-change: transform;
}

.blind-box-element:hover .box-3d-scene {
  transform: rotateX(-20deg) rotateY(30deg);
}

.box-base, .box-lid-3d {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

/* 物理面基础参数 - 优化抗锯齿 */
.face {
  position: absolute;
  width: 160px;
  height: 160px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 1px solid transparent;
  outline: 1px solid transparent; 
  box-shadow: 0 0 1px rgba(0,0,0,0.1), inset 0 0 24px rgba(0,0,0,0.06);
  transform-origin: bottom center;
  backface-visibility: hidden;
  will-change: transform;
}

/* 盒身坐标系拼接与纹理贴图（避免多余 3D 节点边缘锯齿） */
.face.front {
  transform: translateZ(80px);
  background: 
    linear-gradient(90deg, transparent calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), transparent calc(50% + 16.5px)),
    linear-gradient(180deg, transparent calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), transparent calc(50% + 16.5px)),
    linear-gradient(135deg, #f8fafc, #e2e8f0);
}
.face.back {
  transform: rotateY(180deg) translateZ(80px);
  background: 
    linear-gradient(90deg, transparent calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), transparent calc(50% + 16.5px)),
    linear-gradient(135deg, #f8fafc, #e2e8f0);
}
.face.left {
  transform: rotateY(-90deg) translateZ(80px);
  background: 
    linear-gradient(180deg, transparent calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), transparent calc(50% + 16.5px)),
    linear-gradient(135deg, #f8fafc, #e2e8f0);
}
.face.right {
  transform: rotateY(90deg) translateZ(80px);
  background: 
    linear-gradient(180deg, transparent calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), transparent calc(50% + 16.5px)),
    linear-gradient(135deg, #f8fafc, #e2e8f0);
}
.face.bottom { transform: rotateX(-90deg) translateZ(80px); background: #94a3b8; }

.logo {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) translateZ(2px); width: 56px; height: 56px; background: #ffffff; border-radius: 50%; border: 4px solid #fef3c7; color: #f59e0b; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 2;
  will-change: transform;
}

/* 盒盖坐标系拼接 */
.box-lid-3d {
  transform: translateY(-2px);
  will-change: transform;
}

.lid-face {
  position: absolute;
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
  border: 1px solid transparent;
  outline: 1px solid transparent;
  box-shadow: 0 0 1px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.1);
  backface-visibility: hidden;
  will-change: transform;
}

/* 盒盖顶面十字丝带纹理 - 零 DOM 缝隙，纯显卡纹理抗锯齿 */
.lid-face.top {
  width: 164px; height: 164px;
  left: -2px; top: -2px;
  transform: rotateX(90deg) translateZ(82px);
  background: 
    linear-gradient(90deg, transparent calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), transparent calc(50% + 16.5px)),
    linear-gradient(180deg, #ffffff calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), #f1f5f9 calc(50% + 16.5px));
}
.lid-face.front, .lid-face.back, .lid-face.left, .lid-face.right {
  width: 164px; height: 36px;
  top: -2px; left: -2px;
}

.lid-face.front {
  transform: translateZ(82px);
  background: 
    linear-gradient(90deg, transparent calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), transparent calc(50% + 16.5px)),
    linear-gradient(135deg, #ffffff, #f1f5f9);
}
.lid-face.back {
  transform: rotateY(180deg) translateZ(82px);
  background: 
    linear-gradient(90deg, transparent calc(50% - 16.5px), #dc2626 calc(50% - 15.5px), #ef4444 50%, #dc2626 calc(50% + 15.5px), transparent calc(50% + 16.5px)),
    linear-gradient(135deg, #ffffff, #f1f5f9);
}
.lid-face.left  { transform: rotateY(-90deg) translateZ(82px); }
.lid-face.right { transform: rotateY(90deg) translateZ(82px); }

/* 盒芯强光发生器 */
.box-glow-core {
  position: absolute;
  top: 50%; left: 50%; width: 20px; height: 20px;
  background: #fef08a;
  border-radius: 50%;
  box-shadow: 0 0 60px 40px #fef08a;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 100;
}

.box-hidden-prize {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2), inset 0 0 0 4px #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  z-index: 101;
}

.hidden-prize-text {
  font-size: 20px;
  font-weight: 900;
  color: #b45309;
  line-height: 1.2;
}

/* 交互状态类绑定 */
.blind-box-element.is-shaking .box-3d-scene {
  animation: boxShakePhysical 0.1s linear infinite !important;
}

.blind-box-element.is-opening .box-lid-3d {
  animation: lidPopPhysical 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.blind-box-element.is-opening .face.front { animation: unfoldFront 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.blind-box-element.is-opening .face.back { animation: unfoldBack 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.blind-box-element.is-opening .face.left { animation: unfoldLeft 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.blind-box-element.is-opening .face.right { animation: unfoldRight 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.blind-box-element.is-opening .box-glow-core {
  animation: glowBurstPhysical 0.8s ease-in forwards;
}

.blind-box-element.is-opening .box-hidden-prize {
  animation: prizePopOut 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  animation-delay: 0.1s;
}

.blind-box-element.is-opening .box-glow-rays {
  animation: glowBurst 0.6s ease-out forwards;
}

.box-shadow-ground {
  width: 160px;
  height: 20px;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
  margin-top: 20px;
  filter: blur(4px);
  animation: floatY 6s ease-in-out infinite;
  animation-delay: -3s; /* 与盒子的悬浮错开，形成投影放大缩小的错觉 */
}

.box-click-hint {
  margin-top: 24px;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1), transparent);
  padding: 8px 32px;
  border-radius: 20px;
  animation: livePulse 2s infinite;
}

.prize-heading {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.25;
}

.prize-remaining-badge {
  font-size: 15px;
  color: var(--text-muted);
}

.prize-remaining-badge strong {
  color: var(--accent-primary);
  font-size: 18px;
  font-weight: 700;
}

/* Control Panel & Segmented Tab */
.craft-control-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.segmented-mode-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e2e8f0;
  padding: 6px;
  border-radius: 24px;
}

.segment-tab {
  padding: 10px 24px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  user-select: none;
}

.segment-tab input[type="radio"] { display: none; }

.segment-tab.active {
  background: var(--bg-surface);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* Control Panel (Hidden start button since blind box is the trigger) */
.blind-box-controls {
  margin-top: -20px;
  z-index: 3;
}

/* Trigger Main Button */
.btn-trigger-primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 64px;
  border-radius: 32px;
  border: none;
  background: var(--accent-primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.btn-trigger-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: translateX(-100%) skewX(-15deg);
  animation: sweep 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.btn-trigger-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px -4px rgba(239, 68, 68, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.btn-trigger-primary:active {
  transform: translateY(0);
}

/* ==========================================================================
   4. Transition Shuffle Overlay (.shuffle-overlay)
   ========================================================================== */
.shuffle-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(248, 250, 252, 0.4);
  backdrop-filter: blur(32px) saturate(150%);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shuffle-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@keyframes boxPop {
  0% { transform: scale(0.7) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes scanLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.shuffle-box {
  position: relative;
  width: 560px;
  padding: 72px 40px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 40px 100px -20px rgba(0, 0, 0, 0.15),
    inset 0 0 0 1px rgba(255,255,255,0.6),
    0 0 0 8px rgba(255, 255, 255, 0.4);
  text-align: center;
  overflow: hidden;
  animation: boxPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.shuffle-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(239, 68, 68, 0.08) 50%, transparent);
  animation: scanLine 0.7s linear infinite;
  pointer-events: none;
}

.shuffle-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 32px;
  background: #fee2e2;
  padding: 10px 24px;
  border-radius: 24px;
}

.shuffle-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: livePulse 1s infinite;
}

.shuffle-name {
  font-size: 96px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
  line-height: 1.1;
}

/* ==========================================================================
   5. 3D Card Reveal Modal (.reveal-modal-overlay)
   ========================================================================== */
@keyframes modalFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(16px); }
}

@keyframes cardPopIn {
  0% { transform: scale(0.3) translateY(200px); opacity: 0; }
  60% { transform: scale(1.05) translateY(-20px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes godRaysRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.reveal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--ease-smooth);
  animation: modalFadeIn 0.5s var(--ease-smooth) forwards;
}

.reveal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88); /* Dark clean backdrop for focus */
  z-index: 0;
  overflow: hidden;
}

/* 放射性金色光芒背景 (God Rays) */
.reveal-modal-backdrop::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250vw;
  height: 250vw;
  background: conic-gradient(from 0deg, transparent 0deg, var(--god-rays-color) 15deg, transparent 30deg, var(--god-rays-color) 45deg, transparent 60deg, var(--god-rays-color) 75deg, transparent 90deg, var(--god-rays-color) 105deg, transparent 120deg, var(--god-rays-color) 135deg, transparent 150deg, var(--god-rays-color) 165deg, transparent 180deg, var(--god-rays-color) 195deg, transparent 210deg, var(--god-rays-color) 225deg, transparent 240deg, var(--god-rays-color) 255deg, transparent 270deg, var(--god-rays-color) 285deg, transparent 300deg, var(--god-rays-color) 315deg, transparent 330deg, var(--god-rays-color) 345deg, transparent 360deg);
  transform-origin: center;
  animation: godRaysRotate 80s linear infinite;
  pointer-events: none;
}

.reveal-modal-window {
  position: relative;
  z-index: 2;
  width: 92%;
  max-width: 1200px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 24px;
}

.reveal-title-group { text-align: center; margin-bottom: 32px; }
.reveal-kicker { font-size: 14px; font-weight: 700; color: #fca5a5; letter-spacing: 0.1em; }
.reveal-main-heading { font-size: 40px; font-weight: 800; color: #ffffff; margin-top: 8px; }

.cards-deck-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  padding: 24px;
}

/* 针对深色遮罩的定制滚动条 */
.cards-deck-grid::-webkit-scrollbar {
  width: 6px;
}
.cards-deck-grid::-webkit-scrollbar-track {
  background: transparent;
}
.cards-deck-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.cards-deck-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
.cards-deck-grid::-webkit-scrollbar-button {
  display: none;
}

/* Clean Card Mechanics */
.card-3d {
  perspective: 1000px;
  width: 200px;
  height: 280px;
  cursor: pointer;
  user-select: none;
  opacity: 0; /* Init for animation */
  animation: cardPopIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.card-3d:hover .card-inner {
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3);
}

.card-3d.flipped .card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  box-sizing: border-box;
}

.card-front {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.card-front-pattern {
  font-size: 64px;
  margin-bottom: 16px;
}

.card-front-hint {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.card-back {
  transform: rotateY(180deg);
  padding: 24px 16px;
  text-align: center;
}

.card-rarity-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.card-3d.rarity-ssr .card-back { border: 2px solid #f59e0b; }
.card-3d.rarity-ssr .card-rarity-badge { background: #fef3c7; color: #d97706; }

.card-3d.rarity-sr .card-back { border: 2px solid #8b5cf6; }
.card-3d.rarity-sr .card-rarity-badge { background: #ede9fe; color: #7c3aed; }

.card-3d.rarity-r .card-back { border: 2px solid #3b82f6; }
.card-3d.rarity-r .card-rarity-badge { background: #dbeafe; color: #2563eb; }

.card-winner-name { font-size: 24px; font-weight: 900; color: var(--text-primary); margin-bottom: 6px; letter-spacing: 0.05em; }
.card-winner-dept { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 16px; }
.card-prize-tag { font-size: 13px; font-weight: 700; color: var(--accent-primary); background: #fee2e2; padding: 4px 12px; border-radius: 12px; }

/* --- Single Draw Specific Grand Scale --- */
.cards-deck-grid.single-draw .card-3d {
  width: 340px;
  height: 480px;
}
.cards-deck-grid.single-draw .card-front-pattern {
  font-size: 100px;
  margin-bottom: 24px;
}
.cards-deck-grid.single-draw .card-front-hint {
  font-size: 18px;
}
.cards-deck-grid.single-draw .card-rarity-badge {
  font-size: 18px;
  padding: 8px 24px;
  margin-bottom: 32px;
}
.cards-deck-grid.single-draw .card-winner-name {
  font-size: 52px;
  margin-bottom: 16px;
}
.cards-deck-grid.single-draw .card-winner-dept {
  font-size: 22px;
  margin-bottom: 36px;
}
.cards-deck-grid.single-draw .card-prize-tag {
  font-size: 20px;
  padding: 8px 24px;
  border-radius: 16px;
}

@keyframes buttonPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.btn-claim-primary {
  padding: 20px 64px;
  border-radius: 40px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  margin-top: 24px;
  animation: buttonPulse 2s infinite;
}

.btn-claim-primary:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   自适应小屏幕/笔记本分辨率响应式优化 (解决卡片裁剪问题)
   ========================================================================== */
@media (max-height: 860px) {
  .reveal-modal-window {
    padding: 20px 16px;
    max-height: 98vh;
  }
  .reveal-title-group {
    margin-bottom: 16px;
  }
  .reveal-main-heading {
    font-size: 32px;
  }
  .cards-deck-grid {
    padding: 12px;
    max-height: calc(100vh - 180px);
  }
  .cards-deck-grid.single-draw .card-3d {
    width: 280px;
    height: 390px;
  }
  .cards-deck-grid.single-draw .card-front-pattern {
    font-size: 80px;
    margin-bottom: 16px;
  }
  .cards-deck-grid.single-draw .card-rarity-badge {
    font-size: 15px;
    padding: 6px 18px;
    margin-bottom: 20px;
  }
  .cards-deck-grid.single-draw .card-winner-name {
    font-size: 40px;
    margin-bottom: 8px;
  }
  .cards-deck-grid.single-draw .card-winner-dept {
    font-size: 18px;
    margin-bottom: 20px;
  }
  .cards-deck-grid.single-draw .card-prize-tag {
    font-size: 16px;
    padding: 6px 18px;
  }
  .btn-claim-primary {
    padding: 14px 48px;
    font-size: 18px;
    margin-top: 14px;
  }
}

@media (max-height: 720px) {
  .reveal-title-group {
    margin-bottom: 8px;
  }
  .reveal-kicker { font-size: 12px; }
  .reveal-main-heading { font-size: 26px; }
  .cards-deck-grid.single-draw .card-3d {
    width: 240px;
    height: 330px;
  }
  .cards-deck-grid.single-draw .card-front-pattern {
    font-size: 64px;
    margin-bottom: 10px;
  }
  .cards-deck-grid.single-draw .card-winner-name {
    font-size: 32px;
    margin-bottom: 4px;
  }
  .cards-deck-grid.single-draw .card-winner-dept {
    font-size: 15px;
    margin-bottom: 12px;
  }
  .btn-claim-primary {
    padding: 10px 36px;
    font-size: 16px;
    margin-top: 10px;
  }
}

/* ==========================================================================
   5. Side Drawers (.craft-drawer)
   ========================================================================== */
.craft-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 90vw;
  height: 100vh;
  z-index: 900;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease-smooth);
  transform: translateX(0);
}

.craft-drawer.hidden {
  transform: translateX(100%);
}

.drawer-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
}

.drawer-header-row h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); }

.btn-drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
}
.btn-drawer-close:hover { color: var(--text-primary); }

.drawer-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.drawer-section { display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text-secondary); }

.import-tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tile-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 16px;
  background: #f1f5f9;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.tile-button.full-width { grid-column: span 2; }
.tile-button:hover { background: #fee2e2; border-color: #fca5a5; color: var(--accent-primary); }
.tile-button .tile-icon { font-size: 24px; }

.btn-download-outline, .btn-export-gold {
  grid-column: span 2;
  padding: 12px 16px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-download-outline:hover { background: #f8fafc; }
.btn-export-gold { background: var(--accent-primary); color: #ffffff; border: none; width: 100%; }
.btn-export-gold:hover { background: var(--accent-primary-hover); }

.section-title-flex { display: flex; align-items: center; justify-content: space-between; }
.count-tag { font-size: 12px; font-weight: 700; color: var(--accent-blue); background: #dbeafe; padding: 4px 10px; border-radius: 10px; }

.stats-pills-container { display: flex; gap: 10px; margin: 4px 0; }
.stat-pill { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: #f1f5f9; color: var(--text-secondary); }
.stat-pill.green strong { color: #10b981; }
.stat-pill.gold strong { color: var(--accent-gold); }

/* 手动新增人员卡片表单 */
.manual-add-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  padding: 14px;
  border-radius: 16px;
  margin: 6px 0;
}
.manual-add-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.manual-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.manual-form-grid input.input-full {
  grid-column: span 2;
}
.manual-form-grid input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}
.manual-form-grid input:focus {
  border-color: var(--accent-primary);
}
.btn-manual-submit {
  padding: 8px 12px;
  border-radius: 10px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-manual-submit:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.search-field-box input { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-light); background: #f8fafc; color: var(--text-primary); font-size: 14px; outline: none; }
.search-field-box input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px #fee2e2; }

.drawer-scroll-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.member-item .m-name { font-weight: 700; color: var(--text-primary); }
.member-item .m-group { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.member-item.won { opacity: 0.6; text-decoration: line-through; background: #f8fafc; }

.list-empty-tip { font-size: 14px; color: var(--text-muted); text-align: center; padding: 32px 0; border: 2px dashed var(--border-light); border-radius: 16px; background: #f8fafc; }

.danger-zone { border-top: 1px solid var(--border-light); padding-top: 24px; }
.danger-zone .section-title { color: var(--accent-primary); }
.btn-danger-action { padding: 12px; border-radius: 12px; background: #fef2f2; border: 1px solid #fecaca; color: #ef4444; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; width: 100%; transition: all 0.2s ease; }
.btn-danger-action:hover { background: #ef4444; color: #ffffff; }

/* Mobile Adjustments */
@media (max-width: 640px) {
  .craft-navbar { padding: 0 20px; }
  .sequence-nav-container { display: none; }
  .stage-center-vault { padding: 0 16px; }
}

/* ==========================================================================
   6. 🎮 你比我猜 模块专属 UI 样式
   ========================================================================== */
.header-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 20px;
  margin-left: 16px;
}

.nav-tab {
  padding: 8px 18px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab.active {
  background: var(--bg-surface);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   全局 High-End Custom Dialog Modal
   ========================================================================== */
.custom-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

.custom-dialog-box {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: popScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-dialog-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.custom-dialog-header .dialog-icon {
  font-size: 56px;
  line-height: 1;
}

.custom-dialog-header .dialog-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.custom-dialog-body {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
  word-break: break-word;
  white-space: pre-line;
}

.custom-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.btn-dialog-confirm {
  flex: 1;
  padding: 14px 28px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}

.btn-dialog-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(239, 68, 68, 0.45);
}

.btn-dialog-cancel {
  flex: 1;
  padding: 14px 28px;
  border-radius: 20px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dialog-cancel:hover {
  background: #f1f5f9;
  color: #0f172a;
}
