@charset "UTF-8";
/* 抽卡頁面專用樣式 - 神秘主題 */
/* CSS 變數定義 */
:root {
  --primary-deep: #2D1B69;
  --primary-main: #4527A0;
  --primary-light: #7986CB;
  --accent-gold: #FFB300;
  --accent-light: #FFECB3;
  --accent-glow: #FFF9C4;
  --bg-primary: #1A1A2E;
  --bg-secondary: #16213E;
  --bg-card: #0F3460;
  --bg-overlay: rgba(29, 27, 105, 0.9);
  --mystic-red: #8E24AA;
  --mystic-teal: #26A69A;
  --mystic-amber: #FF8F00;
  --mystic-slate: #37474F;
  --text-primary: #E1BEE7;
  --text-secondary: #B8BCC8;
  --text-accent: #FFB300;
  --text-success: #26A69A;
  --text-warning: #FFA726;
  --text-error: #FF6B6B;
  --border-gold: #FFB300;
  --border-purple: #7986CB;
  --border-teal: #26A69A;
  --border-separator: #7986CB;
  --btn-primary: #FFB300;
  --btn-secondary: #4527A0;
  --btn-success: #26A69A;
  --btn-warning: #FFA726;
  --btn-danger: #FF6B6B; }

/* 頁面背景 - 只針對抽卡頁面 */
.card-draw-page body {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--primary-deep) 50%, var(--primary-main) 100%);
  height: 100vh;
  color: var(--text-primary);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  margin: 0;
  padding: 0; }

/* 星空背景效果 - 只針對抽卡頁面 */
.card-draw-page body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20% 30%, var(--accent-gold), transparent), radial-gradient(2px 2px at 40% 70%, var(--primary-light), transparent), radial-gradient(1px 1px at 90% 40%, var(--mystic-teal), transparent), radial-gradient(1px 1px at 10% 80%, var(--accent-gold), transparent), radial-gradient(2px 2px at 70% 20%, var(--primary-light), transparent);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1; }

/* 主容器 - 單屏佈局 */
.mystic-divination-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 15px;
  box-sizing: border-box;
  position: relative; }

/* 問題頭部區域 */
.question-header {
  flex-shrink: 0;
  text-align: center;
  padding: 12px 0;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-deep) 100%);
  border: 1px solid var(--accent-gold);
  border-radius: 12px; }

.question-header h3 {
  color: var(--accent-gold);
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0 0 6px 0;
  text-shadow: 0 2px 8px rgba(255, 179, 0, 0.3); }

.question-text {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin: 0;
  font-weight: 500; }

/* 說明區域 */
.instruction-area {
  flex-shrink: 0;
  text-align: center;
  margin-bottom: 10px; }

.step-info {
  margin-bottom: 10px; }

.step-title {
  color: var(--accent-gold);
  font-size: 1rem;
  font-weight: bold;
  margin: 0 0 6px 0;
  text-shadow: 0 2px 8px rgba(255, 179, 0, 0.3); }

.step-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.3; }

.step-description strong {
  color: var(--text-primary); }

.step-description small {
  color: var(--text-secondary);
  opacity: 0.8; }

/* 自動抽卡按鈕 */
.auto-draw-section {
  margin-top: 10px; }

.auto-draw-btn {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--primary-deep) 100%);
  color: var(--text-primary);
  border: 1px solid var(--border-purple);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease; }

.auto-draw-btn:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.2); }

/* 卡牌選擇區域 - 動態高度適配 */
.card-selection-area {
  flex-shrink: 0;
  /* JavaScript 會動態設置高度 */
  min-height: 200px;
  /* 預設最小高度 */
  max-height: 500px;
  /* 預設最大高度 */
  height: 320px;
  /* 預設高度，會被 JS 覆蓋 */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  position: relative;
  transition: height 0.3s ease;
  /* 平滑高度過渡 */ }

.card-selection {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center; }

.card-fan-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  /* 移除 left: 50%; top: 50%; transform - 避免定位衝突 */
  transition: all 0.3s ease;
  /* 尺寸由 JavaScript 動態設置 */ }

/* 不同佈局類型的特殊效果 */
.card-fan-container[data-layout="linear"] {
  /* 線性排列：添加微妙的背景光暈 */
  background: radial-gradient(ellipse at center, rgba(255, 179, 0, 0.05) 0%, transparent 70%); }

.card-fan-container[data-layout="small-fan"] {
  /* 小扇形：添加扇形光暈 */
  background: radial-gradient(ellipse 120% 60% at center, rgba(123, 104, 238, 0.08) 0%, transparent 70%); }

.card-fan-container[data-layout="semi-circle"] {
  /* 半圓：添加半圓形光暈，重心向上 */
  background: radial-gradient(ellipse 100% 80% at center top, rgba(255, 179, 0, 0.06) 0%, transparent 70%); }

.card-fan-container[data-layout="large-fan"] {
  /* 大扇形：添加大範圍光暈，重心向上 */
  background: radial-gradient(ellipse 120% 90% at center 30%, rgba(138, 43, 226, 0.04) 0%, transparent 70%); }

.card-fan-container[data-layout="full-circle"] {
  /* 完整圓形：添加圓形光暈和旋轉效果 */
  background: radial-gradient(circle at center, rgba(255, 179, 0, 0.03) 0%, rgba(123, 104, 238, 0.02) 50%, transparent 80%);
  animation: mystical-glow 8s ease-in-out infinite; }

@keyframes mystical-glow {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 10px rgba(255, 179, 0, 0.1)); }
  50% {
    filter: brightness(1.05) drop-shadow(0 0 15px rgba(123, 104, 238, 0.15)); } }

/* 進度指示器樣式 - 神秘主題版本 */
.progress-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0; }

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-purple);
  color: var(--text-secondary);
  transition: all 0.3s ease; }

.step-dot.active {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--mystic-amber) 100%);
  border-color: var(--accent-gold);
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.3);
  animation: pulse 2s infinite; }

.step-dot.completed {
  background: var(--mystic-teal);
  border-color: var(--mystic-teal);
  color: white; }

.step-line {
  width: 25px;
  height: 2px;
  background: var(--border-purple);
  transition: all 0.3s ease; }

.step-line.completed {
  background: var(--mystic-teal); }

@keyframes pulse {
  0%, 100% {
    opacity: 1; }
  50% {
    opacity: 0.7; } }

/* 已選擇卡片區域 */
.selected-cards-section {
  flex-shrink: 0;
  margin: 10px 0;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-deep) 100%);
  border: 1px solid var(--border-purple);
  border-radius: 12px;
  padding: 10px; }

.selected-cards-header {
  text-align: center;
  color: var(--accent-gold);
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 10px; }

.selected-cards-container {
  display: flex;
  gap: 10px;
  justify-content: center; }

.selected-card-item {
  flex: 1;
  max-width: 60px;
  text-align: center; }

.selected-card-preview {
  width: 50px;
  height: 70px;
  border-radius: 8px;
  margin: 0 auto 5px;
  border: 2px solid var(--accent-gold);
  position: relative; }

.selected-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover; }

.selected-cards-container small {
  color: var(--text-secondary);
  font-size: 0.75rem; }

/* 卡牌容器基礎樣式 */
.card-container-wrapper {
  display: block;
  width: 45px;
  height: 65px;
  position: absolute;
  transform-origin: center center;
  animation-duration: 0.8s;
  animation-delay: 0.2s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  transition: all 0.4s ease; }

.card-container-wrapper:hover {
  height: 75px;
  z-index: 10; }

.card-container-wrapper {
  z-index: 1; }

/* 卡牌樣式 */
.card-placeholder {
  display: block;
  width: 45px;
  height: 60px;
  position: absolute;
  top: 0;
  cursor: pointer;
  border: 1px solid #b37412;
  border-radius: 4px;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #2c1810 0%, #8b4513 100%); }

.card-placeholder:hover {
  border: 2px solid #FFD700;
  box-shadow: 0px 8px 20px rgba(255, 215, 0, 0.4);
  transform: translateY(-8px); }

.card-placeholder.selected {
  border: 3px solid #FFD700;
  box-shadow: 0px 12px 25px rgba(255, 215, 0, 0.6);
  transform: translateY(-12px); }

.card-placeholder.selected::after {
  content: '✓';
  position: absolute;
  top: 3px;
  right: 3px;
  background: #FFD700;
  color: #6A1B9A;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 10px;
  z-index: 10;
  animation: checkmark-appear 0.3s ease-out; }

@keyframes checkmark-appear {
  0% {
    opacity: 0;
    transform: scale(0); }
  100% {
    opacity: 1;
    transform: scale(1); } }

.card-placeholder .card-number {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(0, 0, 0, 0.8);
  color: #FFD700;
  border-radius: 6px;
  padding: 1px 4px;
  font-size: 8px;
  font-weight: bold;
  z-index: 5; }

/* 卡牌背景圖片 */
.card-background-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  border-radius: 10px; }

.card-background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0.8; }

.card-placeholder:hover .card-background-image {
  opacity: 1;
  transform: scale(1.05);
  transition: all 0.3s ease; }

/* 響應式設計 - 平板版適配 */
@media (max-width: 768px) {
  .card-selection-area {
    min-height: 280px;
    max-height: 380px; }
  .card-container-wrapper {
    width: 40px;
    height: 55px; }
  .card-container-wrapper:hover {
    height: 60px; }
  .card-placeholder {
    width: 40px;
    height: 50px; }
  .card-placeholder .card-number {
    font-size: 7px;
    padding: 1px 3px; } }

/* 響應式設計 - 手機版適配 */
@media (max-width: 480px) {
  .card-selection-area {
    min-height: 240px;
    max-height: 320px;
    margin: 5px 0; }
  .card-container-wrapper {
    width: 30px;
    height: 42px; }
  .card-container-wrapper:hover {
    height: 47px;
    z-index: 10; }
  .card-placeholder {
    width: 30px;
    height: 40px; }
  .card-placeholder .card-number {
    font-size: 6px;
    padding: 1px 2px;
    bottom: 2px;
    left: 2px; }
  .card-placeholder.selected::after {
    width: 10px;
    height: 10px;
    font-size: 7px;
    top: 1px;
    right: 1px; }
  /* 手機版優化：減少邊距 */
  .mystic-divination-container {
    padding: 10px; }
  .question-header {
    padding: 10px;
    margin-bottom: 8px; }
  .instruction-area {
    margin-bottom: 8px; } }

/* 操作按鈕 */
.action-buttons {
  flex-shrink: 0;
  text-align: center;
  padding: 10px 0; }

.mystic-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--mystic-amber) 100%);
  color: var(--bg-primary);
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.3);
  min-width: 150px; }

.mystic-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 179, 0, 0.4); }

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

.mystic-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none; }

.mystic-btn.success {
  background: linear-gradient(135deg, var(--mystic-teal) 0%, var(--mystic-amber) 100%);
  box-shadow: 0 4px 15px rgba(38, 166, 154, 0.3); }

.mystic-btn.success:hover {
  box-shadow: 0 6px 20px rgba(38, 166, 154, 0.4); }

/* 舊版按鈕兼容性 */
.button-container {
  position: relative;
  z-index: 1000;
  margin-top: 30px;
  padding: 20px;
  clear: both; }

.draw-button {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--mystic-amber) 100%);
  border: none;
  padding: 15px 40px;
  border-radius: 25px;
  color: var(--bg-primary);
  font-weight: bold;
  font-size: 18px;
  transition: all 0.3s ease;
  width: 100%;
  position: relative;
  z-index: 1001;
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.3); }

.draw-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 179, 0, 0.4); }

.draw-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none; }

/* 大螢幕電腦版優化 */
@media (min-width: 1201px) {
  .card-selection-area {
    /* 大螢幕限制最大高度，避免過高 */
    max-height: 400px !important; }
  .mystic-divination-container {
    max-width: 600px;
    /* 增加最大寬度 */ } }

/* 中等電腦螢幕優化 */
@media (min-width: 769px) and (max-width: 1200px) {
  .card-selection-area {
    max-height: 380px !important; } }

/* 小螢幕優化 */
@media (max-width: 400px) {
  .mystic-divination-container {
    padding: 8px; }
  .question-header {
    font-size: 1.1rem;
    padding: 8px 15px; }
  .card-selection-area {
    /* 小螢幕保持動態高度，但有更嚴格的限制 */
    max-height: 280px !important; }
  .card {
    width: 50px;
    height: 70px; }
  .mystic-btn {
    font-size: 0.9rem;
    padding: 10px 20px;
    min-width: 120px; }
  .selected-card-preview {
    width: 40px;
    height: 56px; }
  .selected-cards-container small {
    font-size: 0.65rem; } }
