/* Fortune Page (Chat-Hora) — Polished & Pleasurable UX */

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================
   PAGE LAYOUT
   ============================================ */

.fortune-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.6s ease-out;
}

.fortune-card {
  width: min(640px, 100%);
  border-radius: var(--radius2);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.05)
  );
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem;
  backdrop-filter: blur(18px);
  animation: fadeIn 0.8s ease-out 0.2s both;
}

@media (min-width: 640px) {
  .fortune-card {
    padding: 2rem 2rem;
  }
}

/* Results area: outside the card, wider */
.fortune-results-area {
  width: min(800px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

/* ============================================
   HEADER/BRANDING
   ============================================ */

.fortune-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  transition: opacity 0.2s ease;
}

.fortune-brand:hover {
  opacity: 0.85;
}

.fortune-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.fortune-brand__name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.fortune-brand__sub {
  font-size: 0.85rem;
  color: var(--muted2);
}

.fortune-title {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--violet2), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fortune-subtitle {
  margin: 0.5rem 0 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ============================================
   FORM
   ============================================ */

.fortune-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fortune-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .fortune-grid {
    grid-template-columns: 1.6fr 1fr;
    align-items: start;
    gap: 0.75rem;
  }
}

.fortune-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fortune-label {
  font-size: 0.9rem;
  color: var(--muted2);
}

.fortune-dob {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  gap: 0.75rem;
}

/* ============================================
   SELECT DROPDOWNS
   ============================================ */

.fortune-select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  color-scheme: dark;
  padding: 0.85rem 0.95rem;
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.65) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.65) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(1em + 4px),
    calc(100% - 13px) calc(1em + 4px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  transition: all 0.2s ease;
  cursor: pointer;
}

.fortune-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(151, 71, 255, 0.35);
}

.fortune-select:focus {
  border-color: rgba(151, 71, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.15);
  background: rgba(255, 255, 255, 0.09);
}

.fortune-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.fortune-select option {
  background: rgba(11, 7, 32, 0.98);
  color: rgba(255, 255, 255, 0.92);
}

.fortune-help {
  font-size: 0.85rem;
  color: var(--muted2);
}

/* ============================================
   BUTTONS & ACTIONS
   ============================================ */

.fortune-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ============================================
   STATUS & PRECALC
   ============================================ */

.fortune-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.fortune-status:not(:empty) {
  animation: pulse 2s ease-in-out infinite;
}

.fortune-precalc {
  border: 1px solid rgba(181, 140, 255, 0.18);
  background: rgba(181, 140, 255, 0.06);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.6;
  animation: slideInDown 0.4s ease-out;
}

.fortune-precalc strong {
  color: rgba(255, 255, 255, 0.98);
  font-weight: 600;
}

.fortune-precalc > div {
  margin-bottom: 0.35rem;
}

.fortune-precalc > div:last-child {
  margin-bottom: 0;
}

/* Precalc section (Taksaa / Bhavas) */
.precalc-section {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(181, 140, 255, 0.2);
}

.precalc-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--violet2);
  margin-bottom: 0.35rem;
}

/* ---- Precalc Highlights (Taksaa Sri/Kalakinee) ---- */
.precalc-highlight {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.precalc-highlight strong {
  color: rgba(255, 255, 255, 0.98);
}

.precalc-highlight--good {
  background: rgba(100, 230, 150, 0.08);
  border: 1px solid rgba(100, 230, 150, 0.2);
  color: rgba(130, 255, 170, 0.95);
}

.precalc-highlight--warn {
  background: rgba(255, 160, 60, 0.08);
  border: 1px solid rgba(255, 160, 60, 0.2);
  color: rgba(255, 180, 80, 0.95);
}

/* ============================================
   WHEEL (PROMMACHART)
   ============================================ */

.fortune-wheel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 1rem;
  animation: fadeInScale 0.35s ease-out;
}

.fortune-wheel__header {
  font-size: 0.95rem;
  color: var(--muted2);
  margin-bottom: 0.75rem;
}

.fortune-wheel__stage {
  display: grid;
  place-items: center;
  position: relative;
}

.fortune-wheel__pointer {
  position: absolute;
  top: -6px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 16px solid rgba(247, 210, 122, 0.95);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  z-index: 3;
}

.fortune-wheel__ring {
  width: min(320px, 100%);
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgba(181, 140, 255, 0.28);
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(11, 7, 32, 0.72),
      rgba(11, 7, 32, 0.28)
    ),
    linear-gradient(135deg, rgba(181, 140, 255, 0.12), rgba(151, 71, 255, 0.06));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: visible;
}

.fortune-wheel__rotor {
  position: absolute;
  inset: 0;
  transform: rotate(var(--wheel-rotation, 0deg));
  transition: transform 1400ms cubic-bezier(0.12, 0.78, 0.08, 1);
  will-change: transform;
}

.fortune-wheel__items {
  position: absolute;
  inset: 0;
}

.fortune-wheel__item {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  font-size: 0.82rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  user-select: none;
  white-space: nowrap;
}

.fortune-wheel__item span {
  display: inline-block;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.fortune-wheel__item.is-target span {
  border-color: rgba(247, 210, 122, 0.55);
  background: rgba(247, 210, 122, 0.1);
}

.fortune-wheel__label {
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

/* ============================================
   WHEEL DETAIL (after spin stops)
   ============================================ */

.fortune-wheel-detail {
  border-radius: 16px;
  padding: 1.25rem;
  animation: fadeInScale 0.45s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.fortune-wheel-detail__header {
  margin-bottom: 0.65rem;
}

.fortune-wheel-detail__name {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.fortune-wheel-detail__body {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.fortune-wheel-detail__advice {
  font-size: 0.84rem;
  color: rgba(247, 210, 122, 0.9);
  background: rgba(247, 210, 122, 0.06);
  border: 1px solid rgba(247, 210, 122, 0.15);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  line-height: 1.5;
}

.fortune-wheel-detail__advice-label {
  font-weight: 600;
  margin-right: 0.3rem;
}

@media (prefers-reduced-motion: reduce) {
  .fortune-page,
  .fortune-card,
  .fortune-precalc,
  .fortune-wheel,
  .fortune-wheel-detail,
  .fortune-result,
  .fortune-content {
    animation: none !important;
  }

  .fortune-wheel__rotor {
    transition: none !important;
  }
}

/* ============================================
   RESULT SECTION
   ============================================ */

.fortune-result {
  padding-top: 0.5rem;
}

/* ============================================
   FORTUNE BLOCKS (Progressive Reveal)
   ============================================ */

.fortune-block {
  margin-bottom: 1rem;
  border-radius: 16px;
  overflow: hidden;
  animation: blockReveal 0.5s ease-out;
  will-change: opacity, transform;
}

@keyframes blockReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fortune-block__body {
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    padding 0.35s ease;
  overflow: hidden;
}

/* Collapsed state */
.fortune-block.collapsed .fortune-block__body {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ============================================
   PHASE BLOCKS
   ============================================ */

.fortune-phase {
  border: none;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fortune-phase__header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
}

.fortune-phase__badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(181, 140, 255, 0.25);
  border: 1px solid rgba(181, 140, 255, 0.4);
  color: rgba(255, 255, 255, 0.95);
  flex-shrink: 0;
}

.fortune-phase__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  flex: 1;
}

.fortune-phase__status {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 500;
}

.fortune-phase__status[data-status="loading"] {
  color: rgba(247, 210, 122, 0.9);
}
.fortune-phase__status[data-status="loading"]::after {
  content: "กำลังวิเคราะห์...";
  animation: pulse 1.5s ease-in-out infinite;
}

.fortune-phase__status[data-status="done"] {
  color: rgba(130, 230, 170, 0.9);
}
.fortune-phase__status[data-status="done"]::after {
  content: "เสร็จสิ้น";
}

.fortune-phase .fortune-block__body {
  padding: 0.75rem 0;
}

/* ============================================
   THINKING BLOCK
   ============================================ */

.fortune-thinking {
  border: 1px solid rgba(247, 210, 122, 0.2);
  background: linear-gradient(
    135deg,
    rgba(247, 210, 122, 0.08),
    rgba(255, 255, 255, 0.05)
  );
}

.fortune-block__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.fortune-block__toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}

.fortune-block__toggle-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid rgba(247, 210, 122, 0.8);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.fortune-block:not(.collapsed) .fortune-block__toggle-icon {
  transform: rotate(90deg);
}

.fortune-thinking__label {
  font-size: 0.9rem;
  color: rgba(247, 210, 122, 0.95);
  font-weight: 600;
}

.fortune-thinking .fortune-block__body {
  padding: 0 1rem 0.9rem;
}

.fortune-thinking__text {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */

.fortune-progress {
  padding: 1rem 0;
  animation: fadeIn 0.3s ease-out;
}

.fortune-progress__bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.fortune-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--violet2));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.fortune-progress__label {
  font-size: 0.9rem;
  color: var(--muted);
  animation: pulse 2s ease-in-out infinite;
}

/* Shimmer effect on progress bar while loading */
.fortune-progress__fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.fortune-progress__bar {
  position: relative;
}

.fortune-progress__fill {
  position: relative;
}

.fortune-content {
  white-space: normal;
  line-height: 1.7;
  font-size: 1rem;
  animation: fadeIn 0.5s ease-out;
}

/* ---- Markdown: Headings ---- */
.fortune-content h1,
.fortune-content h2,
.fortune-content h3,
.fortune-content h4 {
  font-weight: 700;
  line-height: 1.35;
  margin: 1.2em 0 0.45em;
  color: var(--ink);
}

.fortune-content h1 {
  font-size: 1.45rem;
}
.fortune-content h2 {
  font-size: 1.25rem;
}
.fortune-content h3 {
  font-size: 1.1rem;
}
.fortune-content h4 {
  font-size: 1rem;
}

/* ---- Markdown: Paragraphs ---- */
.fortune-content p {
  margin: 0.65em 0;
}

.fortune-content p:first-child {
  margin-top: 0;
}
.fortune-content p:last-child {
  margin-bottom: 0;
}

/* ---- Markdown: Lists ---- */
.fortune-content ul,
.fortune-content ol {
  margin: 0.6em 0;
  padding-left: 1.5em;
}

.fortune-content li {
  margin: 0.3em 0;
  line-height: 1.65;
}

.fortune-content ul li {
  list-style-type: disc;
}

.fortune-content ol li {
  list-style-type: decimal;
}

.fortune-content ul ul,
.fortune-content ol ol,
.fortune-content ul ol,
.fortune-content ol ul {
  margin: 0.25em 0;
}

/* ---- Markdown: Blockquote ---- */
.fortune-content blockquote {
  margin: 0.85em 0;
  padding: 0.65rem 1rem;
  border-left: 3px solid rgba(181, 140, 255, 0.6);
  background: rgba(181, 140, 255, 0.07);
  border-radius: 0 12px 12px 0;
  color: var(--muted);
  font-style: italic;
}

.fortune-content blockquote p {
  margin: 0;
}

/* ---- Markdown: Horizontal Rule ---- */
.fortune-content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 1.1em 0;
}

/* ---- Markdown: Tables ---- */
.fortune-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85em 0;
  font-size: 0.95rem;
  border-radius: 12px;
  overflow: hidden;
}

.fortune-content th {
  background: rgba(122, 92, 255, 0.18);
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fortune-content td {
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.fortune-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.04);
}

/* ---- Markdown: Strong / Em ---- */
.fortune-content strong {
  font-weight: 700;
  color: var(--ink);
}

.fortune-content em {
  font-style: italic;
  color: var(--muted);
}

/* ---- Markdown: Inline Code & Code Block ---- */
.fortune-content pre {
  overflow: auto;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.fortune-content code {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

/* Inline code (not inside pre) */
.fortune-content :not(pre) > code {
  background: rgba(181, 140, 255, 0.12);
  border: 1px solid rgba(181, 140, 255, 0.2);
  border-radius: 5px;
  padding: 0.12em 0.4em;
  font-size: 0.88em;
  color: var(--violet2);
}

/* ---- Markdown: Links ---- */
.fortune-content a {
  color: var(--violet2);
  text-decoration: underline;
  text-decoration-color: rgba(181, 140, 255, 0.4);
  transition:
    color 0.2s,
    text-decoration-color 0.2s;
}

.fortune-content a:hover {
  color: var(--gold);
  text-decoration-color: rgba(247, 210, 122, 0.6);
}

/* ============================================
   CITATIONS
   ============================================ */

.fortune-citations {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
}

.fortune-citations__title {
  font-size: 0.95rem;
  color: var(--muted2);
  margin-bottom: 0.5rem;
}

.fortune-citation {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 0.65rem;
  transition: all 0.2s ease;
  animation: fadeInScale 0.3s ease-out backwards;
}

.fortune-citation:nth-child(2) {
  animation-delay: 0.05s;
}

.fortune-citation:nth-child(3) {
  animation-delay: 0.1s;
}

.fortune-citation:nth-child(4) {
  animation-delay: 0.15s;
}

.fortune-citation:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(181, 140, 255, 0.3);
  transform: translateX(3px);
}

.fortune-citation__num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(181, 140, 255, 0.18);
  border: 1px solid rgba(181, 140, 255, 0.35);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.fortune-citation:hover .fortune-citation__num {
  background: rgba(181, 140, 255, 0.28);
  border-color: rgba(181, 140, 255, 0.5);
  transform: scale(1.05);
}

.fortune-citation__title {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.fortune-citation__url {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  word-break: break-word;
  transition: color 0.2s ease;
  text-decoration: none;
}

.fortune-citation__url:hover {
  color: rgba(181, 140, 255, 0.9);
  text-decoration: underline;
}

/* ============================================
   FOOTER/PRIVACY
   ============================================ */

.fortune-privacy {
  color: var(--muted2);
  font-size: 0.85rem;
}

/* ============================================
   DAY OF WEEK FORTUNE (InternalPerplex)
   ============================================ */

.fortune-day-of-week {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(255, 179, 71, 0.12),
    rgba(255, 140, 66, 0.08)
  );
  border: 1px solid rgba(255, 179, 71, 0.3);
  animation: slideUp 0.5s ease-out;
}

.fortune-day-of-week__content {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  font-size: 0.95rem;
}

.fortune-day-of-week__content strong {
  color: rgba(255, 200, 140, 1);
}

/* Markdown elements inside day fortune */
.fortune-day-of-week__content h1,
.fortune-day-of-week__content h2,
.fortune-day-of-week__content h3,
.fortune-day-of-week__content h4 {
  color: rgba(255, 220, 180, 0.95);
  margin: 1rem 0 0.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.fortune-day-of-week__content h1:first-child,
.fortune-day-of-week__content h2:first-child,
.fortune-day-of-week__content h3:first-child,
.fortune-day-of-week__content h4:first-child {
  margin-top: 0;
}

.fortune-day-of-week__content h1 {
  font-size: 1.2rem;
}
.fortune-day-of-week__content h2 {
  font-size: 1.1rem;
}
.fortune-day-of-week__content h3 {
  font-size: 1rem;
}
.fortune-day-of-week__content h4 {
  font-size: 0.95rem;
  color: rgba(255, 179, 71, 0.95);
}

.fortune-day-of-week__content p {
  margin: 0.4rem 0;
}

.fortune-day-of-week__content ul,
.fortune-day-of-week__content ol {
  margin: 0.5rem 0;
  padding-left: 1.4rem;
}

.fortune-day-of-week__content li {
  margin: 0.3rem 0;
}

.fortune-day-of-week__content li::marker {
  color: rgba(255, 179, 71, 0.7);
}

.fortune-day-of-week__content em {
  color: rgba(255, 200, 160, 0.9);
  font-style: italic;
}

.fortune-day-of-week__content blockquote {
  margin: 0.6rem 0;
  padding: 0.6rem 1rem;
  border-left: 3px solid rgba(255, 179, 71, 0.4);
  background: rgba(255, 179, 71, 0.06);
  border-radius: 0 8px 8px 0;
  color: rgba(255, 255, 255, 0.85);
}

.fortune-day-of-week__content hr {
  border: none;
  border-top: 1px solid rgba(255, 179, 71, 0.2);
  margin: 0.8rem 0;
}

.fortune-day-of-week__content a {
  color: rgba(255, 200, 140, 0.9);
  text-decoration: underline;
  text-decoration-color: rgba(255, 200, 140, 0.3);
}

.fortune-day-of-week__content a:hover {
  color: rgba(255, 220, 180, 1);
}

.fortune-day-of-week__loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 200, 140, 0.9);
  font-size: 0.95rem;
  padding: 0.5rem 0;
}

.fortune-day-of-week__loading::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 179, 71, 0.2);
  border-top-color: rgba(255, 179, 71, 0.8);
  border-radius: 50%;
  animation: dayFortuneSpin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes dayFortuneSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   WAITING INDICATOR (between day fortune and AI)
   ============================================ */

.fortune-waiting {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(122, 92, 255, 0.12),
    rgba(181, 140, 255, 0.06)
  );
  border: 1px solid rgba(122, 92, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideUp 0.5s ease-out;
}

.fortune-waiting__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(122, 92, 255, 0.2);
  border-top-color: rgba(181, 140, 255, 0.8);
  border-radius: 50%;
  animation: waitingSpin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes waitingSpin {
  to {
    transform: rotate(360deg);
  }
}

.fortune-waiting__text {
  color: rgba(181, 140, 255, 0.95);
  font-size: 1rem;
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
}

.fortune-waiting[hidden] {
  display: none;
}

.fortune-day-of-week__citations {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 179, 71, 0.2);
}

.fortune-day-citations__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 200, 140, 0.8);
  margin-bottom: 0.5rem;
}

.fortune-day-citation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.fortune-day-citation:hover {
  color: rgba(255, 200, 140, 1);
}

.fortune-day-citation__num {
  color: rgba(255, 179, 71, 0.8);
  font-weight: 600;
}

.fortune-day-citation__url {
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

@media (max-width: 640px) {
  .fortune-day-citation__url {
    max-width: 200px;
  }
}

/* ============================================
   FOLLOW-UP CHAT (after reading is done)
   ============================================ */

.fortune-followup {
  margin-top: 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(122, 92, 255, 0.08),
    rgba(181, 140, 255, 0.04)
  );
  border: 1px solid rgba(122, 92, 255, 0.25);
  overflow: hidden;
  animation: slideUp 0.5s ease-out;
}

.fortune-followup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(122, 92, 255, 0.15);
}

.fortune-followup__title {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(181, 140, 255, 0.95);
}

.fortune-followup__count {
  font-size: 0.85rem;
  color: rgba(181, 140, 255, 0.6);
  font-weight: 500;
}

.fortune-followup__messages {
  padding: 0;
}

.fortune-followup__qa {
  border-bottom: 1px solid rgba(122, 92, 255, 0.1);
  animation: slideUp 0.3s ease-out;
}

.fortune-followup__qa:last-child {
  border-bottom: none;
}

.fortune-followup__question {
  padding: 1rem 1.25rem;
  background: rgba(122, 92, 255, 0.06);
}

.fortune-followup__q-label {
  font-weight: 700;
  color: rgba(181, 140, 255, 0.9);
  margin-right: 0.5rem;
}

.fortune-followup__q-text {
  color: rgba(255, 255, 255, 0.9);
}

.fortune-followup__answer {
  padding: 1rem 1.25rem;
}

.fortune-followup__a-content {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

.fortune-followup__a-content p {
  margin: 0.5em 0;
}

.fortune-followup__answer--loading {
  padding: 1.25rem;
}

.fortune-followup__loading-dots {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.fortune-followup__loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(181, 140, 255, 0.6);
  animation: followUpDot 1.4s ease-in-out infinite;
}

.fortune-followup__loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.fortune-followup__loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes followUpDot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.fortune-followup__input-row {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(122, 92, 255, 0.15);
}

.fortune-followup__input {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(122, 92, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.fortune-followup__input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.fortune-followup__input:focus {
  border-color: rgba(181, 140, 255, 0.6);
}

.fortune-followup__input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fortune-followup__send {
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(
    135deg,
    rgba(122, 92, 255, 0.8),
    rgba(181, 140, 255, 0.6)
  );
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.1s ease;
  white-space: nowrap;
}

.fortune-followup__send:hover {
  opacity: 0.9;
}

.fortune-followup__send:active {
  transform: scale(0.97);
}

.fortune-followup__send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fortune-followup__exhausted {
  padding: 1rem 1.25rem;
  text-align: center;
  color: rgba(181, 140, 255, 0.6);
  font-size: 0.9rem;
}

/* ============================================
   ZODIAC SIGN FORTUNE
   ============================================ */

.fortune-zodiac-sign {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(147, 197, 253, 0.12),
    rgba(96, 165, 250, 0.08)
  );
  border: 1px solid rgba(147, 197, 253, 0.3);
  animation: slideUp 0.5s ease-out;
}

.fortune-zodiac-sign__content {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  font-size: 0.95rem;
}

.fortune-zodiac-sign__content strong {
  color: rgba(147, 197, 253, 1);
}

/* ============================================
   ZODIAC YEAR PANEL
   ============================================ */

.zodiac-year-panel {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.12),
    rgba(245, 158, 11, 0.08)
  );
  border: 1px solid rgba(251, 191, 36, 0.3);
  animation: slideUp 0.5s ease-out;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  font-size: 0.95rem;
}

.zodiac-year-panel strong {
  color: rgba(251, 191, 36, 1);
}

/* ============================================
   COMBINED SUMMARY (AI-powered synthesis)
   ============================================ */

.fortune-combined-summary {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.12),
    rgba(139, 92, 246, 0.08)
  );
  border: 1px solid rgba(168, 85, 247, 0.3);
  animation: slideUp 0.5s ease-out;
}

.fortune-combined-summary__content {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  font-size: 0.95rem;
}

.fortune-combined-summary__content strong {
  color: rgba(168, 85, 247, 1);
}

.fortune-combined-summary__loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(168, 85, 247, 0.9);
  font-size: 0.95rem;
  padding: 0.5rem 0;
}

.fortune-combined-summary__loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-top-color: rgba(168, 85, 247, 0.9);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

/* ============================================
   FINAL SYNTHESIS (AI-powered comprehensive)
   ============================================ */

.fortune-final-synthesis {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.12),
    rgba(22, 163, 74, 0.08)
  );
  border: 1px solid rgba(34, 197, 94, 0.3);
  animation: slideUp 0.5s ease-out;
}

.fortune-final-synthesis__content {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  font-size: 0.95rem;
}

.fortune-final-synthesis__content strong {
  color: rgba(34, 197, 94, 1);
}

.fortune-final-synthesis__loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(34, 197, 94, 0.9);
  font-size: 0.95rem;
  padding: 0.5rem 0;
}

.fortune-final-synthesis__loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-top-color: rgba(34, 197, 94, 0.9);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

/* ============================================
   [A0] SYSTEM NOT READY DIALOG
   ============================================ */

.hora-dialog {
  border: none;
  border-radius: 16px;
  background: linear-gradient(145deg, #1e1e2e, #252540);
  color: #e0e0e0;
  padding: 0;
  max-width: 380px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.15);
}

.hora-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.hora-dialog__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 0.75rem;
}

.hora-dialog__icon {
  font-size: 2.5rem;
  line-height: 1;
}

.hora-dialog__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fbbf24;
  margin: 0;
}

.hora-dialog__message {
  font-size: 0.95rem;
  color: #a0a0b8;
  margin: 0;
  line-height: 1.6;
}

.hora-dialog__code {
  font-size: 0.8rem;
  color: #6b6b80;
  font-family: monospace;
  margin: 0;
}

.hora-dialog__btn {
  margin-top: 0.5rem;
  padding: 0.6rem 2.5rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.hora-dialog__btn:hover {
  opacity: 0.9;
}

.hora-dialog__btn:active {
  transform: scale(0.97);
}
