/* Oráculo de Thoth en Ánima. Usa los tokens de anima.css; clases con prefijo th-. */

.th-intro { font-size: 1.7rem; color: var(--ivory); text-align: center; margin: 8px 0 6px; }
.th-kicker { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin: 0 0 4px; }
.th-titulo { font-size: 1.6rem; color: var(--ivory); margin: 0 0 10px; line-height: 1.15; }
.th-texto { color: var(--ivory-dim); line-height: 1.6; margin: 0 0 12px; }
.th-centro { text-align: center; }
.th-consejo { color: var(--ivory); font-size: 1.15rem; font-style: italic; }
.th-error { color: #ff9f8a; margin: 8px 0; }

.th-tiradas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 16px 0 8px; }
.th-tirada { min-height: 64px; background: var(--card); border: 1px solid var(--line); color: var(--ivory); border-radius: 12px; padding: 10px 12px; text-align: left; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 3px; transition: border-color 0.2s; }
.th-tirada span { color: var(--gray); font-size: 0.8rem; }
.th-tirada.act { border-color: var(--uv); box-shadow: 0 0 0 1px var(--uv) inset; }
.th-tirada:focus-visible, .th-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.th-desc { color: var(--ivory-dim); font-size: 0.92rem; margin: 4px 0 14px; }
.th-label { display: block; color: var(--gray); font-size: 0.85rem; margin-bottom: 6px; }
#th-pregunta { width: 100%; min-height: 76px; box-sizing: border-box; background: var(--deep); border: 1px solid var(--line); border-radius: 12px; color: var(--ivory); padding: 12px; font: inherit; resize: vertical; margin-bottom: 14px; }

/* Cartas: proporción nativa del mazo, 768 x 1344 = 4:7 */
.th-mesa { display: grid; gap: 12px; margin: 18px 0; justify-content: center; grid-template-columns: repeat(var(--cols, 3), minmax(0, 150px)); }
.th-mesa.th-n1 { --cols: 1; } .th-mesa.th-n2 { --cols: 2; } .th-mesa.th-n3 { --cols: 3; }
.th-mesa.th-n4, .th-mesa.th-n5 { --cols: 3; }
.th-carta { aspect-ratio: 4 / 7; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid rgba(217, 185, 106, 0.35); background: #0d0b16; box-sizing: border-box; }
.th-carta img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th-dorso { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #1d1832, #0a0912 70%); }
.th-dorso svg { width: 55%; fill: rgba(217, 185, 106, 0.55); }
.th-flota { animation: th-flota 1.8s var(--ease) infinite alternate; }
@keyframes th-flota { from { transform: translateY(0); } to { transform: translateY(-8px); } }

.th-slot { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.th-pos { color: var(--gray); font-size: 0.75rem; text-align: center; }
.th-flip { position: relative; aspect-ratio: 4 / 7; }
.th-flip > .th-carta { position: absolute; inset: 0; }
.th-flip > .th-cara { display: none; }
.th-flip.on > .th-dorso { display: none; }
.th-flip.on > .th-cara { display: flex; }
.th-cara { position: relative; }
.th-cara img { position: absolute; inset: 0; }
.th-nombre { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 0.72rem; font-weight: 400; color: var(--ivory-dim); padding: 0 6px; }
.th-cara img ~ .th-nombre { display: none; }
.th-flip.nueva > .th-cara { animation: th-giro 0.7s var(--ease); }
@keyframes th-giro { from { transform: perspective(600px) rotateY(90deg); } to { transform: perspective(600px) rotateY(0); } }

.th-lecturas { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 18px; }
.th-lectura { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.th-lectura h3 { color: var(--ivory); font-size: 1.3rem; margin: 0 0 8px; }
.th-lectura h3 span { color: var(--gray); font-size: 0.95rem; }
.th-sintesis { margin-bottom: 18px; }

.th-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.th-sheet-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 0 0; width: 100%; max-width: 520px; max-height: 88vh; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px); overflow: auto; padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(18px, env(safe-area-inset-left, 0px)); box-sizing: border-box; }
.th-sheet-box img { display: block; width: min(62%, 240px); aspect-ratio: 4 / 7; object-fit: cover; margin: 0 auto 12px; border-radius: 10px; border: 1px solid rgba(217, 185, 106, 0.35); }
.th-sheet-box h3 { color: var(--ivory); font-size: 1.5rem; margin: 0 0 4px; text-align: center; }
.th-sheet-box .th-kicker { text-align: center; margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  .th-flota { animation: none; }
  .th-flip.nueva > .th-cara { animation: none; }
}
