/* 三国·天命 — Destiny Choice System (天命抉择) CSS */

/* ===== FULL-SCREEN CINEMATIC OVERLAY ===== */
#destiny-choice-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

#destiny-choice-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#destiny-choice-overlay.closing {
  opacity: 0;
  transition: opacity 0.6s ease;
}

#destiny-choice-overlay.hidden {
  display: none;
}

/* ===== BACKGROUND ===== */
.destiny-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(212,168,67,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(139,92,42,0.05) 0%, transparent 50%),
    linear-gradient(180deg, #0a0806 0%, #12100c 40%, #0a0806 100%);
  /* Subtle paper texture via layered gradients */
  background-size: cover;
}

.destiny-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(212,168,67,0.01) 2px,
      rgba(212,168,67,0.01) 4px
    );
  opacity: 0.5;
}

.destiny-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(212,168,67,0.08);
  margin: 16px;
  border-radius: 4px;
  pointer-events: none;
}

/* ===== PARTICLES ===== */
.destiny-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.destiny-particle {
  position: absolute;
  bottom: -10px;
  width: 2px;
  height: 2px;
  background: rgba(212,168,67,0.4);
  border-radius: 50%;
  animation: destinyFloat 6s ease-in infinite;
}

.destiny-particle:nth-child(odd) {
  background: rgba(212,168,67,0.2);
  width: 1px;
  height: 1px;
}

.destiny-particle:nth-child(3n) {
  background: rgba(139,92,42,0.3);
  width: 3px;
  height: 3px;
}

@keyframes destinyFloat {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* ===== CONTENT ===== */
.destiny-choice-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: destinyContentIn 1s ease-out both;
}

@keyframes destinyContentIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== TITLE ===== */
.destiny-choice-title {
  font-size: 32px;
  font-weight: 900;
  color: #d4a843;
  letter-spacing: 12px;
  text-align: center;
  text-shadow:
    0 0 20px rgba(212,168,67,0.3),
    0 0 60px rgba(212,168,67,0.1),
    0 2px 4px rgba(0,0,0,0.8);
  background: linear-gradient(135deg, #d4a843, #f5d98a, #d4a843);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(212,168,67,0.4));
  margin-bottom: 8px;
  animation: destinyTitleGlow 3s ease-in-out infinite;
}

@keyframes destinyTitleGlow {
  0%, 100% { filter: drop-shadow(0 2px 8px rgba(212,168,67,0.3)); }
  50% { filter: drop-shadow(0 2px 16px rgba(212,168,67,0.5)); }
}

/* ===== DECORATIVE LINE ===== */
.destiny-choice-line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,168,67,0.5), transparent);
  margin: 12px 0 24px;
  animation: destinyLineExpand 1.2s 0.5s ease-out both;
}

@keyframes destinyLineExpand {
  0% { width: 0; opacity: 0; }
  100% { width: 200px; opacity: 1; }
}

/* ===== NARRATIVE (TYPEWRITER) ===== */
.destiny-choice-narrative {
  font-size: 16px;
  line-height: 2;
  color: #c8b898;
  text-align: center;
  max-width: 360px;
  min-height: 60px;
  margin-bottom: 40px;
  letter-spacing: 2px;
  cursor: pointer;
  user-select: none;
}

.destiny-choice-narrative::after {
  content: '|';
  animation: destinyCursor 0.8s step-end infinite;
  color: #d4a843;
  margin-left: 2px;
}

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

/* ===== CHOICE OPTIONS ===== */
.destiny-choice-options {
  display: flex;
  gap: 16px;
  width: 100%;
  transition: opacity 0.6s ease;
}

.destiny-options-visible {
  animation: destinyOptionsIn 0.8s ease-out both;
}

@keyframes destinyOptionsIn {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== CHOICE CARDS ===== */
.destiny-card {
  flex: 1;
  padding: 20px 16px;
  background: linear-gradient(145deg, rgba(20,18,14,0.9), rgba(30,26,20,0.8));
  border: 1px solid rgba(212,168,67,0.15);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  /* SFX: future sound cue */
  /* data-sfx="choice_hover" */
}

.destiny-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(212,168,67,0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.destiny-card:hover {
  border-color: rgba(212,168,67,0.5);
  transform: translateY(-4px);
  box-shadow:
    0 8px 32px rgba(212,168,67,0.15),
    0 0 20px rgba(212,168,67,0.08),
    inset 0 1px 0 rgba(212,168,67,0.1);
}

.destiny-card:hover::before {
  opacity: 1;
  animation: destinyCardPulse 2s ease-in-out infinite;
}

@keyframes destinyCardPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.destiny-card:active {
  transform: translateY(-2px) scale(0.98);
}

.destiny-card-label {
  font-size: 14px;
  font-weight: 700;
  color: #d4a843;
  letter-spacing: 4px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.destiny-card-text {
  font-size: 17px;
  font-weight: 700;
  color: #f0e6d3;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.destiny-card-desc {
  font-size: 13px;
  color: #8a7e6d;
  margin-bottom: 10px;
  line-height: 1.5;
}

.destiny-card-hint {
  font-size: 12px;
  color: #d4a843;
  font-style: italic;
  opacity: 0.7;
  border-top: 1px solid rgba(212,168,67,0.1);
  padding-top: 8px;
}

/* Chosen / dimmed states */
.destiny-card-chosen {
  border-color: #d4a843 !important;
  box-shadow: 0 0 40px rgba(212,168,67,0.3), inset 0 0 20px rgba(212,168,67,0.1) !important;
  transform: scale(1.02) !important;
}

.destiny-card-dimmed {
  opacity: 0.2 !important;
  transform: scale(0.95) !important;
  filter: grayscale(1);
}

/* ===== FLASH EFFECT ===== */
.destiny-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #d4a843 0%, rgba(212,168,67,0.5) 30%, transparent 70%);
  z-index: 10;
  animation: destinyFlash 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes destinyFlash {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(2); }
}

/* ===== CONSEQUENCE REVEAL ===== */
.destiny-consequence {
  text-align: center;
  margin-top: 32px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.destiny-consequence.visible {
  opacity: 1;
  transform: translateY(0);
}

.destiny-consequence-label {
  font-size: 14px;
  color: #d4a843;
  letter-spacing: 8px;
  margin-bottom: 12px;
  font-weight: 700;
  animation: destinyLabelPulse 2s ease-in-out infinite;
}

@keyframes destinyLabelPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; text-shadow: 0 0 10px rgba(212,168,67,0.5); }
}

.destiny-consequence-text {
  font-size: 15px;
  color: #c8b898;
  line-height: 1.8;
  max-width: 320px;
  margin: 0 auto 16px;
  letter-spacing: 1px;
}

.destiny-consequence-title {
  font-size: 16px;
  font-weight: 700;
  color: #d4a843;
  margin-bottom: 16px;
  padding: 8px 20px;
  background: rgba(212,168,67,0.1);
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: 8px;
  display: inline-block;
}

/* ===== CONTINUE BUTTON ===== */
.destiny-continue-btn {
  display: inline-block;
  padding: 12px 40px;
  background: linear-gradient(135deg, #d4a843, #b8922e);
  color: #0a0a0a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.3s ease;
  /* SFX: future sound cue */
  /* data-sfx="destiny_confirm" */
}

.destiny-continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(212,168,67,0.3);
}

.destiny-continue-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ===== DESTINY RECORD (天命录) ===== */
.destiny-record {
  padding: 0 4px;
}

.destiny-record-header {
  text-align: center;
  margin-bottom: 24px;
}

.destiny-record-title {
  font-size: 28px;
  font-weight: 900;
  color: #d4a843;
  letter-spacing: 12px;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(212,168,67,0.3);
  background: linear-gradient(135deg, #d4a843, #f5d98a, #d4a843);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.destiny-record-subtitle {
  font-size: 13px;
  color: #8a7e6d;
  font-style: italic;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.destiny-record-titles {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.destiny-title-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, rgba(212,168,67,0.15), rgba(184,146,46,0.1));
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #d4a843;
  letter-spacing: 2px;
}

.destiny-record-reputation {
  font-size: 13px;
  color: #d4a843;
  font-weight: 600;
}

/* ===== TIMELINE ===== */
.destiny-timeline {
  position: relative;
  padding-left: 24px;
}

.destiny-timeline-item {
  position: relative;
  padding-bottom: 28px;
  padding-left: 20px;
}

.destiny-timeline-item:last-child {
  padding-bottom: 0;
}

/* Timeline dot */
.destiny-timeline-dot {
  position: absolute;
  left: -6px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a1816;
  border: 2px solid #3a3632;
  z-index: 1;
  transition: all 0.3s;
}

.destiny-timeline-dot.active {
  background: #d4a843;
  border-color: #d4a843;
  box-shadow: 0 0 12px rgba(212,168,67,0.4);
}

/* Timeline connecting line */
.destiny-timeline-line {
  position: absolute;
  left: -1px;
  top: 16px;
  width: 2px;
  bottom: 0;
  background: #2a2622;
}

.destiny-timeline-line.active {
  background: linear-gradient(180deg, rgba(212,168,67,0.5), rgba(212,168,67,0.1));
}

/* Timeline content */
.destiny-timeline-content {
  background: rgba(20,18,14,0.6);
  border: 1px solid rgba(212,168,67,0.08);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.3s;
}

.destiny-timeline-item.decided .destiny-timeline-content {
  border-color: rgba(212,168,67,0.15);
}

.destiny-timeline-item.decided .destiny-timeline-content:hover {
  border-color: rgba(212,168,67,0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.destiny-timeline-title {
  font-size: 15px;
  font-weight: 700;
  color: #f0e6d3;
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.destiny-timeline-item.pending .destiny-timeline-title {
  color: #5c5448;
}

.destiny-timeline-chosen {
  font-size: 13px;
  color: #d4a843;
  font-weight: 600;
  margin-bottom: 4px;
}

.destiny-chosen-label {
  color: #d4a843;
}

.destiny-timeline-other {
  font-size: 12px;
  color: #5c5448;
  text-decoration: line-through;
  margin-bottom: 6px;
}

.destiny-timeline-consequence {
  font-size: 12px;
  color: #8a7e6d;
  line-height: 1.6;
  font-style: italic;
  padding-top: 6px;
  border-top: 1px solid rgba(212,168,67,0.06);
}

.destiny-timeline-date {
  font-size: 10px;
  color: #4a4440;
  margin-top: 4px;
}

.destiny-timeline-pending {
  font-size: 13px;
  color: #3a3632;
  font-style: italic;
  letter-spacing: 2px;
}

/* ===== DESTINY RECORD SECTION IN PROFILE ===== */
.destiny-record-section {
  margin-top: 16px;
}

.destiny-record-section .card {
  background: linear-gradient(145deg, rgba(12,10,8,0.95), rgba(18,16,12,0.9));
  border: 1px solid rgba(212,168,67,0.1);
}

/* ===== DESTINY INDICATOR ON HOME PAGE ===== */
.destiny-home-card {
  background: linear-gradient(145deg, rgba(20,18,14,0.9), rgba(30,26,20,0.8));
  border: 1px solid rgba(212,168,67,0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.destiny-home-card:hover {
  border-color: rgba(212,168,67,0.4);
  box-shadow: 0 4px 20px rgba(212,168,67,0.1);
}

.destiny-home-title {
  font-size: 15px;
  font-weight: 700;
  color: #d4a843;
  letter-spacing: 4px;
  margin-bottom: 6px;
}

.destiny-home-subtitle {
  font-size: 12px;
  color: #8a7e6d;
}

.destiny-home-stats {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.destiny-home-stat {
  font-size: 12px;
  color: #c8b898;
}

.destiny-home-stat b {
  color: #d4a843;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
  .destiny-choice-title {
    font-size: 24px;
    letter-spacing: 8px;
  }

  .destiny-choice-narrative {
    font-size: 14px;
  }

  .destiny-choice-options {
    flex-direction: column;
    gap: 12px;
  }

  .destiny-card {
    padding: 16px 14px;
  }

  .destiny-card-text {
    font-size: 15px;
  }
}
