/* ดูดวง — full-screen app. Orb + overlay accent uses var(--accent) so it follows the selected theme
   (see CLAUDE.md Theme vars rule). Lucky-color swatches stay literal — they're the fortune's own data, not UI flavor.
   .fortune-wrap's own background is a fixed dark base (set from JS via fortuneApplyTint, not this file) — an
   intentional exception, not theme-following: the mystical backdrop is the screen's own flavor. Every element
   that sits directly on it (not inside its own var(--card)-backed card) needs a fixed color too, not var(--text)/
   var(--sub) — those flip to dark-on-dark in light themes. .fortune-hint, .fortune-category-btn, and
   .fortune-history-fab (pinned to the bottom of the screen via margin-top:auto) are the ones that do; the cards in between
   (.fortune-last-card, .fortune-topic-btn, .fortune-topic-tip) carry their own var(--card)/var(--card-hi)
   background+text pairing so they stay self-consistent per theme same as .fortune-overlay-card already does. */

.fortune-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 16px 24px;
  transition: background 0.4s ease;
}

.fortune-mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.fortune-mode-btn {
  background: var(--card-hi);
  border: none;
  color: var(--sub);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.fortune-mode-btn.active {
  background: var(--accent);
  color: #fff;
}

.fortune-history-fab {
  margin-top: auto;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.fortune-topic-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.fortune-topic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card);
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text);
  padding: 20px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.fortune-topic-icon {
  font-size: 26px;
}

.fortune-topic-detail {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}

.fortune-topic-tip {
  width: 100%;
  font-size: 13px;
  color: var(--sub);
  line-height: 1.5;
  text-align: left;
  background: var(--card-hi);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.fortune-topic-tip-label {
  font-weight: 700;
  color: var(--accent);
  margin-right: 6px;
}

.fortune-orb-btn {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-circle);
  border: none;
  background: radial-gradient(circle at 35% 30%, var(--card-hi), var(--accent) 70%);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fortune-orb-icon {
  font-size: 56px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.35));
}

@keyframes fortune-glow {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.18), var(--shadow-xl);
  }
  100% {
    transform: scale(1);
  }
}

.fortune-orb-btn.glowing {
  animation: fortune-glow 0.7s var(--ease-bounce);
}

.fortune-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

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

.fortune-category-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.fortune-category-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.fortune-last-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: none;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}

.fortune-last-label {
  font-size: 12px;
  color: var(--sub);
}

.fortune-last-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fortune-last-id {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.fortune-last-stars {
  font-size: 13px;
  letter-spacing: 1px;
}

.fortune-last-title {
  font-size: 14px;
  color: var(--text);
}

.fortune-star {
  color: var(--hairline);
}

.fortune-star.filled {
  color: var(--accent);
}

.fortune-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 1000;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-base) ease;
  padding: 24px;
  overflow-y: auto;
}

.fortune-overlay.show {
  opacity: 1;
}

.fortune-overlay-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  cursor: default;
  transform: scale(0.85);
  transition: transform var(--duration-slow) var(--ease-bounce);
}

.fortune-overlay.show .fortune-overlay-card {
  transform: scale(1);
}

.fortune-card-id {
  font-size: 13px;
  color: var(--sub);
}

.fortune-card-stars {
  font-size: 22px;
  letter-spacing: 2px;
}

.fortune-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.fortune-card-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.fortune-card-row {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.4;
}

.fortune-card-label {
  flex: 0 0 62px;
  font-weight: 700;
  color: var(--accent);
}

.fortune-card-row-empty {
  font-size: 13px;
  color: var(--sub);
  font-style: italic;
  text-align: center;
}

.fortune-card-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.fortune-lucky {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.fortune-lucky-label {
  color: var(--sub);
}

.fortune-lucky-value {
  font-weight: 700;
  color: var(--text);
}

.fortune-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-circle);
  box-shadow: 0 0 0 1px var(--hairline);
}

.fortune-overlay-next-btn {
  background: #fff;
  color: #1a1a1a;
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

.fortune-overlay-hint {
  color: var(--sub);
  font-size: 13px;
}

.fortune-history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 1000;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-base) ease;
  padding: 24px;
}

.fortune-history-overlay.show {
  opacity: 1;
}

.fortune-history-panel {
  width: 100%;
  max-width: 360px;
  max-height: 80vh;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: default;
}

.fortune-history-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.fortune-history-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fortune-history-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fortune-history-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-hi);
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.fortune-history-del {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--sub);
  font-size: 16px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.fortune-history-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.fortune-history-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fortune-history-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fortune-history-item-meta {
  font-size: 11px;
  color: var(--sub);
}

.fortune-history-item-time {
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--sub);
  white-space: nowrap;
}

.fortune-history-empty {
  color: var(--sub);
  font-size: 13px;
  text-align: center;
  padding: 16px 0;
  font-style: italic;
}

.fortune-history-clear-btn {
  align-self: center;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--sub);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  cursor: pointer;
}
