/* =============================================
   Tarot dos Orixas — style.css
   Upload para: /css/style.css
   ============================================= */

/* ============================================================
   VARIAVEIS
   ============================================================ */
:root {
  --bg-deep:    #0f0620;
  --bg-dark:    #1a0a2e;
  --bg-mid:     #2a1045;
  --bg-card:    #3d1a5e;
  --gold:       #c9a84c;
  --gold-light: #e8cc80;
  --gold-dim:   rgba(201,168,76,0.15);
  --purple-mid: #7a4a9e;
  --purple-dim: #4a2a6e;
  --text-main:  #f0e6c8;
  --text-muted: #a88fc0;
  --text-dim:   #5a4a6e;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --transition: 0.2s ease;
}

/* ============================================================
   RESET E BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: #0f0620;
  background-color: var(--bg-deep);
  color: #f0e6c8;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ============================================================
   FUNDO ESTRELAS
   ============================================================ */
.stars-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 45%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 75%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 85%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 30%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 90%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 70%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 50%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 35%, rgba(255,255,255,0.3) 0%, transparent 100%);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  background: radial-gradient(ellipse at top, #2d0f3d 0%, transparent 70%);
}

.site-badge {
  display: inline-block;
  font-family: sans-serif;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

/* Orb */
.orb-container {
  margin: 0 auto 1.5rem;
  position: relative;
  width: 110px;
  height: 110px;
}

.orb {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #8b3d9e 0%, #2d0a3d 70%);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  animation: orb-pulse 4s ease-in-out infinite;
}

.orb-ring {
  position: absolute;
  top: -8px; left: -8px;
  width: 126px; height: 126px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.2);
  animation: spin 6s linear infinite;
}

@keyframes orb-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(138,50,180,0.3); }
  50%       { box-shadow: 0 0 40px rgba(138,50,180,0.5), 0 0 60px rgba(138,50,180,0.2); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Titulos hero */
.hero-title {
  font-size: 2rem;
  font-weight: normal;
  color: var(--text-main);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-family: sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Botao CTA principal */
.btn-cta {
  display: inline-block;
  background-color: #c9a84c;
  background-color: var(--gold);
  color: #0f0620;
  color: var(--bg-deep);
  font-family: sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 36px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform 0.1s;
  letter-spacing: 0.5px;
}

.btn-cta:hover  { background-color: var(--gold-light); }
.btn-cta:active { transform: scale(0.98); }

.hero-note {
  font-family: sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 0.75rem;
}

/* ============================================================
   DIVISOR E SECOES
   ============================================================ */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--purple-dim), transparent);
}

.section     { padding: 2.5rem 1rem; }
.section-alt { padding: 2.5rem 1rem; background: rgba(0,0,0,0.2); }

.section-title {
  font-size: 1.05rem;
  font-weight: normal;
  color: var(--gold);
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 1.75rem;
}

.section-title::before,
.section-title::after {
  content: " \2726 ";
  opacity: 0.5;
  font-size: 0.7rem;
}

/* ============================================================
   BOTOES DE TIRAGEM
   ============================================================ */
.spread-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 2rem;
}

.spread-btn {
  background-color: var(--bg-mid);
  border: 1px solid var(--purple-dim);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background-color var(--transition);
  color: var(--text-main);
}

.spread-btn:hover  { border-color: var(--gold); }
.spread-btn:focus  { outline: 2px solid var(--gold); outline-offset: 2px; }
.spread-btn.active { border-color: var(--gold); background-color: var(--bg-card); }

.spread-icon { font-size: 22px; margin-bottom: 6px; }

.spread-name {
  font-family: sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.spread-desc {
  font-family: sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ============================================================
   CARTAS
   ============================================================ */
.cards-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.card-wrap {
  perspective: 800px;
  cursor: pointer;
}

.card-wrap:focus { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: var(--radius-sm); }

.card-inner {
  position: relative;
  width: 76px;
  height: 116px;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.card-wrap.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: var(--radius-sm);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--purple-dim);
}

/* Verso da carta */
.card-back {
  background-color: var(--bg-mid);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(201,168,76,0.04) 0px,
    rgba(201,168,76,0.04) 1px,
    transparent 1px,
    transparent 8px
  );
}

.card-back::after {
  content: "\2726";
  font-size: 24px;
  color: var(--purple-dim);
}

/* Frente da carta */
.card-front {
  transform: rotateY(180deg);
  background-color: var(--bg-card);
  border-color: var(--gold);
  padding: 6px 4px;
}

.card-symbol {
  font-size: 28px;
  margin-bottom: 4px;
  line-height: 1;
}

.card-name {
  font-family: sans-serif;
  font-size: 9px;
  color: var(--gold);
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

.card-position-label {
  font-family: sans-serif;
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 5px;
}

.cards-hint {
  font-family: sans-serif;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 1rem;
}

/* ============================================================
   PAINEL DE LEITURA
   ============================================================ */
#reading-panel {
  display: none;
  margin-top: 1rem;
}

#reading-panel.visible {
  display: block;
  animation: fade-in 0.5s ease;
}

.reading-item {
  background-color: var(--bg-mid);
  border: 1px solid var(--purple-dim);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
  animation: fade-in 0.4s ease;
}

#reading-panel.visible {
  background-color: var(--bg-mid);
  border: 1px solid var(--purple-dim);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Cabecalho da leitura */
.reading-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(74,42,110,0.5);
}

.reading-avatar,
.mini-avatar {
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.reading-avatar { width: 48px; height: 48px; font-size: 22px; }
.mini-avatar    { width: 36px; height: 36px; font-size: 18px; }

.reading-orixa-name {
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 3px;
}

.reading-position {
  font-family: sans-serif;
  font-size: 11px;
  color: var(--text-dim);
}

.reading-text {
  font-size: 14px;
  color: #c8b8d8;
  line-height: 1.85;
  margin: 0;
}

/* Keywords */
.reading-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.reading-keywords span {
  font-family: sans-serif;
  font-size: 11px;
  color: var(--gold);
  background-color: var(--gold-dim);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 20px;
  padding: 3px 12px;
}

/* Cabecalho item multi-carta */
.reading-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.reading-item + .reading-item {
  margin-top: 10px;
}

/* ============================================================
   COMPARTILHAR
   ============================================================ */
.share-area {
  text-align: center;
  margin-top: 1.5rem;
  display: none;
}

.share-area.visible { display: block; }

.share-area p {
  font-family: sans-serif;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.share-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-share {
  font-family: sans-serif;
  font-size: 13px;
  padding: 9px 20px;
  border-radius: 30px;
  border: 1px solid;
  cursor: pointer;
  transition: opacity var(--transition), transform 0.1s;
  background: none;
}

.btn-share:hover  { opacity: 0.85; }
.btn-share:active { transform: scale(0.97); }

.btn-whatsapp {
  background-color: rgba(37,211,102,0.12);
  color: #25d366;
  border-color: rgba(37,211,102,0.3);
}

.btn-copy {
  background-color: var(--bg-mid);
  color: var(--text-muted);
  border-color: var(--purple-dim);
}

.btn-nova {
  background-color: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(201,168,76,0.3);
}

/* ============================================================
   GRID DE ORIXAS
   ============================================================ */
.orixas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.orixa-card {
  background-color: var(--bg-mid);
  border: 1px solid var(--purple-dim);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  text-decoration: none;
  display: block;
  color: inherit;
}

.orixa-card:hover {
  border-color: var(--gold);
  background-color: var(--bg-card);
}

.orixa-symbol  { font-size: 26px; margin-bottom: 6px; line-height: 1.2; }
.orixa-name    { font-family: sans-serif; font-size: 12px; font-weight: 600; color: var(--gold); }
.orixa-element { font-family: sans-serif; font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* ============================================================
   PAGINA DE ORIXA INDIVIDUAL
   ============================================================ */
.orixa-hero {
  text-align: center;
  padding: 2rem 0;
}

.orixa-big-symbol {
  font-size: 64px;
  display: block;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.orixa-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 1.5rem 0;
}

.orixa-detail-card {
  background-color: var(--bg-mid);
  border: 1px solid var(--purple-dim);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.orixa-detail-label {
  font-family: sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 5px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.orixa-detail-value {
  font-size: 15px;
  color: var(--text-main);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background-color: var(--bg-deep);
  border-top: 1px solid var(--purple-dim);
}

footer p {
  font-family: sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.8;
}

footer a {
  color: var(--gold);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: var(--bg-card);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 30px;
  padding: 10px 24px;
  font-family: sans-serif;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   LINK VOLTAR
   ============================================================ */
.back-link {
  font-family: sans-serif;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  display: inline-block;
  padding: 1.5rem 0 0;
  transition: color var(--transition);
}

.back-link:hover { color: var(--gold); }

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   IMAGEM DA CARTA
   ============================================================ */
.card-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 7px;
}

/* Carta frente sem padding quando tem imagem */
.card-front { padding: 0; overflow: hidden; }

/* Botao consultar no jogo */
#btn-jogar {
  font-size: 14px;
  padding: 14px 30px;
  line-height: 1.5;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

#btn-jogar span {
  display: block;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 480px) {
  .hero-title    { font-size: 1.6rem; }
  .orixas-grid   { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .orixa-card    { padding: 10px 4px; }
  .orixa-symbol  { font-size: 22px; }
  .card-inner    { width: 68px; height: 104px; }
  .card-symbol   { font-size: 24px; }
  .spread-types  { grid-template-columns: 1fr 1fr; }
  .orixa-detail-grid { grid-template-columns: 1fr; }
  .btn-cta       { padding: 12px 28px; font-size: 14px; }
}

@media (max-width: 360px) {
  .orixas-grid { grid-template-columns: repeat(2, 1fr); }
}
