/**
 * 539 獨立「今日專屬・本命財運釣號」專屬樣式表
 * 檔案路徑: static/css/lottery_539_fortune.css
 * 100% 獨立隔離，專屬 539 核心版位，支援手機端 (iOS/Android) 自適應排版
 */

.fortune-539-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(8, 14, 26, 0.98));
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 24px rgba(245, 158, 11, 0.15);
  overflow: hidden;
  margin-top: 14px;
}

.fortune-539-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #fef08a, #10b981, #f59e0b);
  background-size: 200% 100%;
  animation: fortuneGlowBorder 3.5s linear infinite;
}

@keyframes fortuneGlowBorder {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* 頂部標題 */
.fortune-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fortune-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fortune-icon-badge {
  font-size: 1.7rem;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
  animation: fortuneIconFloat 2.5s ease-in-out infinite;
}

@keyframes fortuneIconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.fortune-title-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fortune-main-title {
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fef08a, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fortune-sub-text {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

.fortune-status-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* 下拉輸入區 */
.fortune-input-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.fortune-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fortune-select-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fortune-select-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

.fortune-select {
  width: 100%;
  background: #1e293b;
  border: 1.5px solid rgba(245, 158, 11, 0.3);
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.fortune-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.fortune-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* 超大發光按鈕 */
.btn-fortune-draw {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 60%, #b45309 100%);
  color: #0b1120;
  border: none;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.45);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.2s;
}

.btn-fortune-draw:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.65);
  filter: brightness(1.05);
}

.btn-fortune-draw:active {
  transform: translateY(1px);
}

.btn-fortune-sparkle {
  font-size: 1.25rem;
}

/* 1.5 秒震撼羅盤動效 */
.fortune-loading-fx {
  background: rgba(15, 23, 42, 0.85);
  border: 1px dashed rgba(245, 158, 11, 0.5);
  border-radius: 12px;
  padding: 24px 16px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.1);
}

.bagua-compass-spinner {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 3.5px solid rgba(245, 158, 11, 0.25);
  border-top: 3.5px solid #f59e0b;
  border-right: 3.5px solid #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spinCompass 3.5s linear infinite;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  transition: box-shadow 0.4s, border-color 0.4s;
}

.bagua-compass-spinner.fast {
  animation: spinCompass 0.55s linear infinite !important;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.9), 0 0 50px rgba(239, 68, 68, 0.6) !important;
  border-top-color: #ef4444 !important;
  border-right-color: #f59e0b !important;
}

/* 12 秒日沖專屬：深紫玄鐵黑霧光環與煞氣動盪動效 */
.bagua-compass-spinner.ominous-clash {
  border-color: rgba(76, 29, 149, 0.4) !important;
  border-top-color: #c084fc !important;
  border-right-color: #581c87 !important;
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.85), 0 0 60px rgba(15, 23, 42, 0.95), inset 0 0 20px rgba(88, 28, 135, 0.9) !important;
  animation: spinCompassOminous 1.4s ease-in-out infinite !important;
}

@keyframes spinCompassOminous {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(200deg); }
  100% { transform: rotate(360deg); }
}

/* 晴天霹靂雷暴全螢幕閃電視覺覆蓋層 (模擬閃電劈落血光/白光強烈閃爍) */
.fortune-lightning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  background: #ffffff;
}

.fortune-lightning-overlay.strike-flash {
  animation: lightningStrobe 0.85s ease-out forwards;
}

@keyframes lightningStrobe {
  0% { opacity: 0; background: #ffffff; }
  10% { opacity: 0.98; background: #ffffff; }
  22% { opacity: 0.08; background: #ef4444; }
  35% { opacity: 0.95; background: #fee2e2; }
  50% { opacity: 0.45; background: #dc2626; }
  70% { opacity: 0.2; background: #7f1d1d; }
  100% { opacity: 0; background: transparent; }
}

/* 晴天霹靂震裂地動山搖 Shake 視覺動效 */
.fortune-earthquake-shake {
  animation: thunderEarthquake 0.75s cubic-bezier(.36,.07,.19,.97) both !important;
}

@keyframes thunderEarthquake {
  10%, 90% { transform: translate3d(-4px, 3px, 0); }
  20%, 80% { transform: translate3d(6px, -5px, 0); }
  30%, 50%, 70% { transform: translate3d(-8px, 6px, 0); }
  40%, 60% { transform: translate3d(7px, -4px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes spinCompass {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.compass-core {
  font-size: 1.7rem;
  color: #fef08a;
  animation: counterSpin 3.5s linear infinite;
  transition: transform 0.3s, color 0.3s;
}

.bagua-compass-spinner.fast .compass-core {
  animation: counterSpin 0.55s linear infinite !important;
  color: #ffedd5 !important;
  filter: drop-shadow(0 0 10px #f59e0b);
}

.bagua-compass-spinner.ominous-clash .compass-core {
  color: #c084fc !important;
  filter: drop-shadow(0 0 12px #9333ea) !important;
  animation: counterSpinOminous 1.6s ease-in-out infinite !important;
}

@keyframes counterSpinOminous {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-200deg); }
  100% { transform: rotate(-360deg); }
}

@keyframes counterSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

.compass-fx-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fx-pulsing-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #fef08a;
  animation: pulseGlow 1.8s infinite ease-in-out;
  transition: all 0.3s;
}

.fx-pulsing-title.urgent {
  color: #fca5a5 !important;
  font-size: 1.08rem !important;
  animation: urgentPulseGlow 0.45s infinite alternate !important;
}

.fx-pulsing-title.ominous {
  color: #d8b4fe !important;
  font-size: 1.04rem !important;
  animation: ominousPulseGlow 0.8s infinite alternate !important;
}

@keyframes ominousPulseGlow {
  0% { transform: scale(1); text-shadow: 0 0 8px #9333ea; }
  100% { transform: scale(1.03); text-shadow: 0 0 18px #a855f7, 0 0 30px #6b21a8; }
}

@keyframes urgentPulseGlow {
  0% { transform: scale(1); text-shadow: 0 0 8px #f87171; }
  100% { transform: scale(1.05); text-shadow: 0 0 20px #f59e0b, 0 0 30px #ef4444; }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; text-shadow: 0 0 8px rgba(245, 158, 11, 0.7); }
}

.fx-pulsing-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* 開獎結果卡片 */
.fortune-result-card {
  margin-top: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(245, 158, 11, 0.1);
  animation: popInCard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popInCard {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 命理標籤列 */
.result-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.result-meta-chip {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.result-meta-highlight {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fef08a;
}

/* 核心號碼展示：三中一大尺寸金球 */
.fortune-balls-showcase {
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.showcase-title {
  font-size: 0.98rem;
  font-weight: 900;
  color: #fef08a;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

.showcase-crown {
  font-size: 1.2rem;
}

.fortune-balls-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.fortune-gold-ball {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fef08a 0%, #f59e0b 50%, #92400e 100%);
  color: #1c1917;
  font-size: 1.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  letter-spacing: -0.5px;
  animation: ballGlowPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes ballGlowPop {
  0% { transform: scale(0.2); opacity: 0; filter: brightness(2); }
  100% { transform: scale(1); opacity: 1; filter: brightness(1); }
}

/* 吉方吉時 */
.fortune-auspicious-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 8px;
  padding: 10px 12px;
}

.auspicious-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
}

.auspicious-label {
  color: #94a3b8;
  font-weight: 600;
}

.auspicious-val {
  color: #38bdf8;
  font-weight: 800;
}

/* 命理解釋語錄 */
.fortune-commentary-box {
  background: rgba(30, 41, 59, 0.65);
  border-left: 3.5px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.commentary-header {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fef08a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.commentary-content {
  font-size: 0.85rem;
  color: #f1f5f9;
  line-height: 1.55;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* 規矩二：免責與博弈安全警示條 */
.fortune-disclaimer-strip {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.disclaimer-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.disclaimer-text {
  font-size: 0.76rem; /* 12px ~ 13px */
  color: #94a3b8;
  line-height: 1.5;
/* 日辰相剋勸退令卡片樣式 */
.fortune-clash-card {
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(38, 12, 19, 0.95), rgba(20, 8, 14, 0.98));
  border: 1.5px solid rgba(239, 68, 68, 0.65);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(239, 68, 68, 0.25);
  animation: popInClashCard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popInClashCard {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.clash-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(239, 68, 68, 0.25);
  padding-bottom: 10px;
}

.clash-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.clash-header-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clash-main-title {
  font-size: 1.18rem;
  font-weight: 900;
  color: #fca5a5;
  letter-spacing: 0.5px;
}

.clash-sub-title {
  font-size: 0.78rem;
  color: #f87171;
  font-weight: 700;
}

.clash-content-box {
  background: rgba(15, 23, 42, 0.6);
  border-left: 3.5px solid #ef4444;
  border-radius: 8px;
  padding: 12px 14px;
}

.clash-body-text {
  font-size: 0.88rem;
  color: #fecaca;
  line-height: 1.6;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.clash-footer-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.clash-badge {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* 手機適配 */
@media (max-width: 640px) {
  .fortune-539-card {
    padding: 16px 12px;
  }
  .fortune-main-title {
    font-size: 1.12rem;
  }
  .fortune-select-grid {
    gap: 6px;
  }
  .fortune-select {
    font-size: 0.82rem;
    padding: 8px 4px;
    padding-right: 20px;
  }
  .btn-fortune-draw {
    font-size: 1rem;
    padding: 12px;
  }
  .fortune-gold-ball {
    width: 52px;
    height: 52px;
    font-size: 1.48rem;
  }
  .fortune-balls-row {
    gap: 12px;
  }
  .fortune-auspicious-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
