/* ===== CSS 設計系統 ===== */
:root {
  /* 色彩系統 */
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1628;
  --bg-card: rgba(255, 255, 255, 0.04);
  
  --sahel-primary: #d4890a;
  --sahel-secondary: #f0a030;
  --sahel-accent: #ff6b35;
  --sahel-glow: rgba(212, 137, 10, 0.4);
  
  --socal-primary: #1a9e5f;
  --socal-secondary: #2dd4a0;
  --socal-accent: #4fc3f7;
  --socal-glow: rgba(26, 158, 95, 0.4);
  
  --text-primary: #e8eaf6;
  --text-secondary: rgba(232, 234, 246, 0.7);
  --text-muted: rgba(232, 234, 246, 0.4);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.15);
  
  /* 字體 */
  --font-chinese: 'Noto Sans TC', sans-serif;
  --font-display: 'Orbitron', monospace;
  
  /* 圓角 */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  
  /* 陰影 */
  --shadow-card: 0 25px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow-sahel: 0 0 60px rgba(212, 137, 10, 0.2);
  --shadow-glow-socal: 0 0 60px rgba(26, 158, 95, 0.2);
}

/* ===== 重置 & 基礎 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-chinese);
  -webkit-font-smoothing: antialiased;
}

/* ===== 滾動條 ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* ===== 3D Canvas 背景 ===== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
}

/* ===== 粒子層 ===== */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: float-particle linear infinite;
  opacity: 0;
}

@keyframes float-particle {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1.5);
  }
}

/* ===== 遊戲Canvas容器 ===== */
#game-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#game-canvas {
  width: 100%;
  height: 100%;
}

/* ===== 過渡動畫 ===== */
#transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.transition-content {
  text-align: center;
  color: var(--text-primary);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top: 3px solid var(--sahel-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 通用按鈕 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-chinese);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

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

/* ===== 標籤 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
}

/* ===== 工具提示 ===== */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,40,0.95);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  border: 1px solid var(--border-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.tooltip:hover::after {
  opacity: 1;
}

/* ===== 玻璃態效果 ===== */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

/* ===== 漸層文字 ===== */
.gradient-text-sahel {
  background: linear-gradient(135deg, var(--sahel-primary), var(--sahel-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-socal {
  background: linear-gradient(135deg, var(--socal-primary), var(--socal-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
