/* Xem bói tarot — main styles */
[hidden] { display: none !important; }

.tr-container { max-width: 980px; padding-top: 40px; }

.back-link { display: inline-block; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; transition: color 0.2s ease; }
.back-link:hover { color: var(--accent); }

.tr-hero { margin-bottom: 32px; }
.tr-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.tr-hero .tagline { font-size: 0.95rem; }

.tr-loading { text-align: center; color: var(--text-muted); padding: 32px; font-size: 0.92rem; }

.tr-phase {
  background: linear-gradient(180deg, rgba(124,156,255,0.05), rgba(168,85,247,0.04));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 28px; text-align: center;
  min-height: 360px; display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.tr-phase-title { font-size: 1.4rem; margin: 16px 0 8px; }
.tr-phase-desc { color: var(--text-muted); font-size: 0.95rem; max-width: 480px; margin: 0 0 20px; }

/* Mystic orb */
.tr-mystic-orb {
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c4b5fd, #7c3aed 60%, #1a0f3a);
  box-shadow: 0 0 30px rgba(124,156,255,0.4), 0 0 60px rgba(168,85,247,0.2);
  margin-bottom: 12px; animation: tr-pulse 3s ease-in-out infinite;
}
@keyframes tr-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* Buttons */
.tr-btn-primary, .tr-btn-ghost {
  font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 11px 22px; border-radius: 8px; cursor: pointer;
  transition: all 0.15s ease; border: 1px solid transparent;
}
.tr-btn-primary { background: var(--accent); color: #0b0d12; border-color: var(--accent); }
.tr-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,156,255,0.3); }
.tr-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.tr-btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.tr-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Deck phase */
.tr-deck-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tr-deck-pile { position: relative; width: 110px; height: 170px; margin-bottom: 16px; }
.tr-deck-back {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #2a1f5c 0%, #4c1d95 50%, #1a0f3a 100%);
  border: 2px solid rgba(196,181,253,0.4); border-radius: 10px;
  transform: translate(calc(var(--ofs, 0) * 4px), calc(var(--ofs, 0) * 4px)) rotate(calc(var(--ofs, 0) * 1.5deg));
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.tr-deck-back::before {
  content: '✦'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); font-size: 1.4rem; color: rgba(196,181,253,0.8);
}
.tr-deck-pile.is-shuffling .tr-deck-back { animation: tr-shuffle 0.4s ease; }
@keyframes tr-shuffle {
  0% { transform: translate(calc(var(--ofs, 0) * 4px), calc(var(--ofs, 0) * 4px)) rotate(0deg); }
  50% { transform: translate(calc(var(--ofs, 0) * 12px), -8px) rotate(calc((var(--ofs, 0) - 1) * 8deg)); }
  100% { transform: translate(calc(var(--ofs, 0) * 4px), calc(var(--ofs, 0) * 4px)) rotate(calc(var(--ofs, 0) * 1.5deg)); }
}
.tr-deck-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Spread phase */
.tr-spread-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tr-spread-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 720px; width: 100%; margin-top: 12px; }
.tr-spread-slot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tr-spread-pos {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase;
}
.tr-spread-card {
  width: 100%; max-width: 200px; aspect-ratio: 2 / 3; padding: 0;
  background: transparent; border: none; cursor: pointer;
  perspective: 800px;
}
.tr-card-face {
  width: 100%; height: 100%; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 12px; text-align: center;
  transition: transform 0.2s ease;
}
.tr-card-face.is-back {
  background: linear-gradient(135deg, #2a1f5c 0%, #4c1d95 50%, #1a0f3a 100%);
  border: 2px solid rgba(196,181,253,0.4); color: rgba(196,181,253,0.9);
  font-size: 3rem; font-weight: 700;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
.tr-spread-card:hover .tr-card-face.is-back { transform: translateY(-4px) scale(1.02); }
.tr-card-face.is-front {
  background: linear-gradient(180deg, #1a1f2e 0%, #2a1f5c 100%);
  border: 2px solid var(--accent); color: var(--text);
  box-shadow: 0 0 24px rgba(124,156,255,0.25);
  animation: tr-flip-in 0.4s ease;
}
.tr-card-face.is-front.reversed { transform: rotate(180deg); }
.tr-card-face.is-front.reversed > * { transform: rotate(0deg); }
@keyframes tr-flip-in {
  from { transform: rotateY(180deg); opacity: 0; }
  to { transform: rotateY(0deg); opacity: 1; }
}
.tr-card-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; line-height: 1.2; }
.tr-card-arcana { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.06em; margin-bottom: 10px; }
.tr-card-keywords { font-size: 0.78rem; color: var(--accent); line-height: 1.4; }

/* Reading */
.tr-reading {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 24px;
}
.tr-reading-title { margin: 0 0 16px; font-size: 1.2rem; color: var(--accent); text-align: center; }
.tr-reading-p { margin: 0 0 12px; line-height: 1.65; color: var(--text); }
.tr-reading-summary {
  margin: 16px 0 0; padding: 14px 16px; line-height: 1.65;
  background: var(--accent-glow); border-left: 3px solid var(--accent); border-radius: 6px;
  color: var(--text); font-style: italic;
}
.tr-disclaimer { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--border); }
.tr-spread-actions { display: flex; justify-content: center; margin-top: 18px; }
