/* =============================================
   AI 分析畫面 — 每日 Gemini 報告
   ============================================= */

/* ── 遊戲切換 ────────────────────────────── */

.ai-controls {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.ai-game-toggle {
  display: flex;
  gap: var(--sp-1);
  background: var(--bg-raised);
  border-radius: var(--r-full);
  padding: 3px;
}
.ai-game-btn {
  padding: 6px var(--sp-4);
  border: none;
  border-radius: var(--r-full);
  background: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-base);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.ai-game-btn.active        { background: var(--bg-overlay); color: var(--text-primary); }
.ai-game-btn.active.gold   { color: var(--lotto-gold); }
.ai-game-btn.active.red    { color: var(--power-red);  }
.ai-game-btn.active.green  { color: #4CAF50; }

/* ── 農民曆雙欄區塊 ──────────────────────── */

.ai-almanac-row {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.ai-almanac-card {
  flex: 1;
  min-width: 240px;
  background: var(--bg-raised);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ai-almanac-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.ai-almanac-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--weight-normal);
  font-family: var(--font-num);
}
.ai-almanac-body {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.9;
}
.ai-almanac-row-item {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
}
.ai-almanac-label {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 72px;
}
.ai-almanac-do        { color: #f6c90e; }
.ai-almanac-dont      { color: #f28b82; }
.ai-almanac-direction { color: #81c995; }

/* ── 報告日期標示 ────────────────────────── */

.ai-report-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-raised);
  border-radius: var(--r-sm);
  display: inline-block;
}

/* ── 走勢摘要 ────────────────────────────── */

.ai-trend-summary {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  background: var(--bg-raised);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}
.ai-trend-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── 結果區 ──────────────────────────────── */

.ai-results {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.ai-cards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* ── 策略卡片 ────────────────────────────── */

.ai-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  transition: border-color 0.2s;
}
.ai-card:hover { border-color: rgba(255,255,255,0.13); }

/* 左側色條 */
.ai-card--momentum { border-left: 3px solid #f28b82; }
.ai-card--reversal { border-left: 3px solid #81c995; }
.ai-card--stable   { border-left: 3px solid #7baaf7; }
.ai-card--contra   { border-left: 3px solid #c792ea; }

/* ── 卡片標頭 ────────────────────────────── */

.ai-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.ai-strategy-icon {
  font-size: 16px;
  line-height: 1;
}
.ai-strategy-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

/* ── 號碼球列 ────────────────────────────── */

.ai-balls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.ai-balls .sep {
  color: var(--text-muted);
  font-size: 18px;
  margin: 0 2px;
}
.ai-balls-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 2px;
}

/* ── 信心指數 ────────────────────────────── */

.ai-confidence {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.ai-confidence-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ai-confidence-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ai-confidence-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.ai-confidence-value {
  font-size: 12px;
  font-weight: var(--weight-bold);
  font-family: var(--font-num);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

/* ── 卡片主體（雷達圖 + 理由並排）────────── */

.ai-card-body {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: var(--sp-3);
}
.ai-radar-wrap {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
}
.ai-radar-canvas {
  width: 140px !important;
  height: 140px !important;
}
.ai-reason {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.75;
  padding-top: 4px;
}

/* ── 空狀態 ─────────────────────────────── */

.ai-empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--text-muted);
}
.ai-empty-icon { font-size: 48px; margin-bottom: var(--sp-3); }
.ai-empty p    { font-size: var(--text-sm); line-height: 1.7; }

/* ── 付費牆 ──────────────────────────────── */

.ai-paywall-wrap {
  position: relative;
  min-height: 320px;
}

/* 背景模糊預覽 */
.ai-paywall-blur {
  filter: blur(6px);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}
.ai-blur-cards {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* 覆蓋層 */
.ai-paywall-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-base, #0f0f13) 55%);
  padding: var(--sp-4);
}

/* 主卡片 */
.ai-paywall-card {
  width: 100%;
  max-width: 340px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ai-paywall-lock {
  font-size: 36px;
  margin-bottom: var(--sp-3);
}

.ai-paywall-greeting {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
}

/* 利益列表 */
.ai-paywall-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-5);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.ai-paywall-benefits li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.ai-paywall-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 11px;
  font-weight: var(--weight-bold);
  padding: 3px 10px;
  border-radius: var(--r-full);
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-1);
}

/* CTA 按鈕 */
.ai-paywall-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.ai-paywall-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 11px var(--sp-6);
  border: none;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-family: var(--font-base);
  cursor: pointer;
  transition: opacity 0.15s;
}
.ai-paywall-cta:hover { opacity: 0.88; }
.ai-paywall-cta--upgrade {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}
.ai-paywall-cta--login {
  background: var(--lotto-gold);
  color: #1a1a2e;
}
.ai-paywall-cta--line {
  background: #06C755;
  color: #fff;
}
.ai-linepay-logo {
  display: inline-block;
  background: #fff;
  color: #06C755;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.6;
  flex-shrink: 0;
}
.ai-paywall-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-base);
  padding: 4px 8px;
}
.ai-paywall-logout:hover { color: var(--text-secondary); }

/* ── AI 運算中 Loading ───────────────────── */

.ai-lc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ai-lc {
  position: relative;
  border-radius: 16px;
  padding: 2px;
  overflow: hidden;
  animation: aiLcBreathe 3s ease-in-out infinite;
}

.ai-lc::before {
  content: '';
  position: absolute;
  inset: -60%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 60deg,
    #6ee7f7 80deg,
    #a78bfa 100deg,
    #f472b6 120deg,
    transparent 150deg,
    transparent 360deg
  );
  animation: aiLcSpin 2.4s linear infinite;
  border-radius: 50%;
}

.ai-lc-inner {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 28px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 160px;
  justify-content: center;
}

.ai-lc-lock {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(110, 231, 247, 0.7))
          drop-shadow(0 0 20px rgba(167, 139, 250, 0.4));
  animation: aiLcPulse 2.4s ease-in-out infinite;
}

.ai-lc-skeleton {
  width: 65%;
  height: 9px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  border-radius: 5px;
  animation: aiLcShimmer 1.8s ease-in-out infinite;
}

.ai-lc-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 3px;
}

.ai-lc-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6ee7f7;
  display: inline-block;
  animation: aiLcDot 1.2s ease-in-out infinite;
}
.ai-lc-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-lc-dot:nth-child(3) { animation-delay: 0.4s; }

.ai-lc-bar-wrap {
  width: 75%;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.ai-lc-bar {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #6ee7f7, #a78bfa, #f472b6);
  border-radius: 2px;
  animation: aiLcBar 2.4s ease-in-out infinite;
}

/* 四張卡片錯開起始角度與呼吸節奏 */
.ai-lc-grid .ai-lc:nth-child(1)::before { animation-delay:  0s;   }
.ai-lc-grid .ai-lc:nth-child(2)::before { animation-delay: -0.6s; }
.ai-lc-grid .ai-lc:nth-child(3)::before { animation-delay: -1.2s; }
.ai-lc-grid .ai-lc:nth-child(4)::before { animation-delay: -1.8s; }
.ai-lc-grid .ai-lc:nth-child(1) { animation-delay:  0s;   }
.ai-lc-grid .ai-lc:nth-child(2) { animation-delay: -0.7s; }
.ai-lc-grid .ai-lc:nth-child(3) { animation-delay: -1.4s; }
.ai-lc-grid .ai-lc:nth-child(4) { animation-delay: -2.1s; }

@keyframes aiLcSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes aiLcBreathe {
  0%, 100% { opacity: 1;    box-shadow: 0 0 18px rgba(110,231,247,0.08); }
  50%       { opacity: 0.85; box-shadow: 0 0 32px rgba(167,139,250,0.20); }
}
@keyframes aiLcPulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 8px rgba(110,231,247,0.7)) drop-shadow(0 0 20px rgba(167,139,250,0.4)); }
  50%       { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(110,231,247,1)) drop-shadow(0 0 32px rgba(167,139,250,0.7)); }
}
@keyframes aiLcDot {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
  40%            { transform: translateY(-5px); opacity: 1;   }
}
@keyframes aiLcBar {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(280%);  }
}
@keyframes aiLcShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 免責聲明 ────────────────────────────── */

.ai-disclaimer {
  margin-top: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-raised);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}
