/* ==========================================================================
   掌心解碼 (Kaiyun Code) - 神籤占卜、擲筊儀式與 AI 命理師專屬樣式庫
   ========================================================================== */

/* 寺廟神龕神殿氛圍 */
.sanctuary-header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}
.temple-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(245, 158, 11, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  color: #FDE047;
  font-weight: 700;
  margin-bottom: 10px;
}
.incense-glow {
  position: relative;
  display: inline-block;
}
.incense-glow::after {
  content: '♨️';
  position: absolute;
  top: -15px;
  right: -25px;
  font-size: 1.2rem;
  animation: smokeFloat 3s infinite ease-in-out;
  opacity: 0.8;
}
@keyframes smokeFloat {
  0% { transform: translateY(0) scale(0.9); opacity: 0.3; }
  50% { transform: translateY(-10px) scale(1.1); opacity: 0.8; }
  100% { transform: translateY(-20px) scale(1.3); opacity: 0; }
}

/* 籤筒搖動動畫區塊 */
.fortune-cylinder-box {
  background: radial-gradient(circle at center, rgba(45, 25, 60, 0.9), rgba(18, 12, 35, 0.95));
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 24px;
  padding: 30px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.15);
  margin-bottom: 24px;
}
.cylinder-icon {
  font-size: 4rem;
  margin-bottom: 14px;
  display: inline-block;
  transition: transform 0.2s ease;
}
.cylinder-icon.shaking {
  animation: cylinderShake 0.6s infinite ease-in-out;
}
@keyframes cylinderShake {
  0% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-12deg) translateY(-8px); }
  50% { transform: rotate(10deg) translateY(-4px); }
  75% { transform: rotate(-8deg) translateY(-10px); }
  100% { transform: rotate(0deg) translateY(0); }
}

/* 3D 擲筊區塊 (Bwa Bwei Divination Blocks) */
.blocks-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 24px 0;
  perspective: 600px;
}
.bwa-block {
  width: 70px;
  height: 105px;
  background: linear-gradient(145deg, #DC2626, #991B1B);
  border-radius: 50% 50% 12% 12% / 60% 60% 10% 10%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 2px 5px rgba(255, 255, 255, 0.3);
  position: relative;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif TC', serif;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}
.bwa-block.convex {
  /* 凸面朝上 (陰) */
  transform: rotateY(0deg) rotateZ(-10deg);
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.bwa-block.flat {
  /* 平面朝上 (陽/平) */
  background: linear-gradient(145deg, #F59E0B, #D97706);
  transform: rotateY(180deg) rotateZ(10deg);
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.bwa-block.tossing {
  animation: bwaToss 0.8s ease-in-out;
}
@keyframes bwaToss {
  0% { transform: translateY(0) rotateX(0deg) rotateY(0deg) scale(1); }
  50% { transform: translateY(-70px) rotateX(360deg) rotateY(540deg) scale(1.2); }
  100% { transform: translateY(0) scale(1); }
}

.bwa-result-badge {
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  padding: 8px 18px;
  border-radius: 30px;
  margin: 12px auto;
  display: inline-block;
}
.badge-sheng {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFF;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}
.badge-xiao {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFF;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}
.badge-yin {
  background: linear-gradient(135deg, #EF4444, #B91C1C);
  color: #FFF;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* 古典籤詩卡片 */
.oracle-card-box {
  background: #FFFDF5;
  color: #26170E;
  border: 2px solid #D4AF37;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(212, 175, 55, 0.15);
  margin-bottom: 20px;
  position: relative;
  font-family: 'Noto Serif TC', serif;
}
.oracle-header {
  border-bottom: 1.5px solid #D4AF37;
  padding-bottom: 10px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.oracle-poem-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 2;
  text-align: center;
  letter-spacing: 2px;
  margin: 16px 0;
  color: #3B1C10;
  white-space: pre-line;
}
.oracle-grade {
  font-size: 0.95rem;
  color: #B91C1C;
  font-weight: 800;
  border: 1.5px solid #B91C1C;
  padding: 2px 8px;
  border-radius: 6px;
}

/* AI 命理大師即時對話區 (Master AI Sanctuary) */
.counselor-chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 520px;
  background: rgba(18, 14, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  margin-top: 14px;
}
.counselor-header {
  padding: 14px 18px;
  background: rgba(28, 22, 58, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.counselor-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--purple-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 2px solid var(--primary-gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.counselor-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFF;
}
.counselor-status {
  font-size: 0.75rem;
  color: #10B981;
  display: flex;
  align-items: center;
  gap: 4px;
}
.counselor-status::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10B981;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-bubble {
  max-width: 84%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}
.bubble-master {
  align-self: flex-start;
  background: rgba(45, 36, 85, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #F3F4F6;
  border-bottom-left-radius: 4px;
}
.bubble-user {
  align-self: flex-end;
  background: var(--purple-gradient);
  color: #FFF;
  border-bottom-right-radius: 4px;
}

/* Quick Suggestion Chips */
.suggestion-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
  background: rgba(14, 11, 30, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.chip-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-gold);
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}
.chip-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--primary-gold);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(20, 16, 44, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.chat-input {
  flex: 1;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 0 16px;
  color: #FFF;
  font-size: 0.88rem;
  outline: none;
}
.chat-input:focus {
  border-color: #A855F7;
}
.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cta-gradient);
  border: none;
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.chat-send-btn:hover {
  transform: scale(1.08);
}
