/* ================================================
   TAROT SI O NO - 3 CARTAS - APP STYLES
   ================================================ */

.ts3-app {
    --ts3-indigo: #2c3e6b;
    --ts3-indigo-oscuro: #1a2744;
    --ts3-indigo-claro: #4a6fa5;
    --ts3-dorado: #ffd700;
    --ts3-dorado-oscuro: #b8960f;
    --ts3-dorado-claro: #ffe44d;
    --ts3-gradiente-mistico: linear-gradient(135deg, #1a2744 0%, #2c3e6b 50%, #4a6fa5 100%);
    --ts3-gradiente-dorado: linear-gradient(135deg, #b8960f 0%, #ffd700 50%, #ffe44d 100%);
    --ts3-gradiente-boton: linear-gradient(135deg, #2c3e6b 0%, #4a6fa5 100%);
    --ts3-sombra: 0 10px 30px rgba(44, 62, 107, 0.3);
    --ts3-sombra-hover: 0 15px 40px rgba(44, 62, 107, 0.4);
    --ts3-radio: 16px;
    --ts3-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
    width: 100%;
}

/* ================================================
   FASE PREGUNTA
   ================================================ */

.ts3-fase {
    animation: ts3FadeIn 0.6s ease;
}

@keyframes ts3FadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ts3-pregunta-contenido {
    text-align: center;
    padding: 2.5rem 1rem;
}

.ts3-icono-oraculo {
    font-size: 4rem;
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    animation: ts3Brillar 3s ease-in-out infinite;
}

@keyframes ts3Brillar {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.2); }
}

.ts3-destello {
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: ts3Destello 3s ease-in-out infinite;
    pointer-events: none;
}

.ts3-destello::before { content: '✦'; }
.ts3-d2::before { content: '✧'; }
.ts3-d3::before { content: '⭐'; }

.ts3-d1 { animation-delay: -0.5s; top: -10px; left: 10px; }
.ts3-d2 { animation-delay: -1.5s; top: -5px; right: 15px; }
.ts3-d3 { animation-delay: -2.5s; bottom: 5px; left: 25px; }

@keyframes ts3Destello {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 0.8; transform: translateY(-20px) scale(1); }
}

.ts3-titulo-pregunta {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--ts3-gradiente-dorado);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ts3-subtitulo-pregunta {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Formulario */
.ts3-form {
    max-width: 520px;
    margin: 0 auto 1.5rem;
    text-align: left;
}

.ts3-campo {
    margin-bottom: 1.5rem;
}

.ts3-label {
    display: block;
    color: var(--ts3-dorado-claro);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ts3-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    transition: var(--ts3-transicion);
    box-sizing: border-box;
}

.ts3-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    transition: var(--ts3-transicion);
    box-sizing: border-box;
    min-height: 100px;
    resize: vertical;
}

.ts3-input:focus,
.ts3-textarea:focus {
    outline: none;
    border-color: var(--ts3-dorado);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.ts3-input::placeholder,
.ts3-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ts3-char-count {
    display: block;
    text-align: right;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* Boton consultar */
.ts3-btn-consultar {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--ts3-gradiente-dorado);
    color: var(--ts3-indigo-oscuro);
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ts3-transicion);
    font-family: inherit;
    box-shadow: var(--ts3-sombra);
    width: 100%;
    justify-content: center;
}

.ts3-btn-consultar:hover {
    transform: translateY(-3px);
    box-shadow: var(--ts3-sombra-hover);
}

.ts3-btn-consultar:active {
    transform: translateY(-1px);
}

.ts3-btn-icono {
    font-size: 1.3rem;
}

.ts3-instruccion {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ================================================
   LOADING
   ================================================ */

.ts3-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 0.5rem;
}

.ts3-loading-carta {
    width: 55px;
    height: 85px;
    background: var(--ts3-gradiente-mistico);
    border-radius: 10px;
    animation: ts3Barajar 1.4s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(44, 62, 107, 0.4);
    margin-bottom: 0.3rem;
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.ts3-loading-carta-2 {
    animation-delay: -0.3s;
}

.ts3-loading-carta-3 {
    animation-delay: -0.6s;
}

@keyframes ts3Barajar {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    20% { transform: translateY(-18px) rotate(-6deg); }
    40% { transform: translateY(-5px) rotate(4deg); }
    60% { transform: translateY(-12px) rotate(-2deg); }
    80% { transform: translateY(-2px) rotate(3deg); }
}

.ts3-loading-texto {
    color: rgba(255, 215, 0, 0.7);
    font-size: 1rem;
    animation: ts3Pulso 1.5s ease-in-out infinite;
    margin-top: 0.8rem;
}

@keyframes ts3Pulso {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ================================================
   FASE RESULTADO
   ================================================ */

.ts3-resultado-contenido {
    padding: 2rem 1rem;
}

.ts3-resultado-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ts3-resultado-titulo {
    font-size: 1.8rem;
    background: var(--ts3-gradiente-dorado);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.ts3-resultado-subtitulo {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-style: italic;
}

/* Grid de cartas */
.ts3-cartas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.ts3-carta-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 215, 0, 0.12);
    border-radius: var(--ts3-radio);
    padding: 1.5rem 1rem;
    text-align: center;
    animation: ts3SlideIn 0.6s ease;
    transition: var(--ts3-transicion);
}

.ts3-carta-item:nth-child(2) { animation-delay: 0.1s; animation-fill-mode: both; }
.ts3-carta-item:nth-child(3) { animation-delay: 0.2s; animation-fill-mode: both; }

.ts3-carta-item:hover {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 5px 20px rgba(44, 62, 107, 0.2);
}

@keyframes ts3SlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ts3-carta-posicion {
    font-size: 0.75rem;
    color: var(--ts3-dorado);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.ts3-carta-icono {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.ts3-carta-nombre {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ts3-carta-significado {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Veredicto */
.ts3-veredicto {
    text-align: center;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    animation: ts3SlideIn 0.6s ease 0.3s both;
}

.ts3-veredicto-icono {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.ts3-veredicto-texto {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
}

.ts3-veredicto-mensaje {
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto;
}

.ts3-veredicto-bg-si {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.ts3-veredicto-bg-no {
    background: rgba(239, 83, 80, 0.1);
    border: 2px solid rgba(239, 83, 80, 0.3);
}

.ts3-veredicto-bg-tal-vez {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid rgba(255, 193, 7, 0.3);
}

.ts3-veredicto-texto-si { color: #4caf50; }
.ts3-veredicto-texto-no { color: #ef5350; }
.ts3-veredicto-texto-tal-vez { color: #ffc107; }

.ts3-veredicto-mensaje-si { color: rgba(76, 175, 80, 0.85); }
.ts3-veredicto-mensaje-no { color: rgba(239, 83, 80, 0.85); }
.ts3-veredicto-mensaje-tal-vez { color: rgba(255, 193, 7, 0.85); }

/* Interpretacion general */
.ts3-interpretacion {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 215, 0, 0.12);
    border-radius: var(--ts3-radio);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    animation: ts3SlideIn 0.6s ease 0.4s both;
}

.ts3-interpretacion-titulo {
    color: var(--ts3-dorado);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.ts3-interpretacion-texto {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.ts3-interpretacion-texto:last-child {
    margin-bottom: 0;
}

/* Boton nueva consulta */
.ts3-btn-nueva {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 2px solid rgba(255, 215, 0, 0.25);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ts3-transicion);
    margin-top: 1rem;
    font-family: inherit;
}

.ts3-btn-nueva:hover {
    background: rgba(44, 62, 107, 0.3);
    border-color: var(--ts3-dorado);
    transform: translateY(-2px);
}

/* ================================================
   PARTICULAS DE FONDO
   ================================================ */

.ts3-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 25% 35%, rgba(44, 62, 107, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 25%, rgba(255, 215, 0, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 75%, rgba(74, 111, 165, 0.05) 0%, transparent 50%);
    animation: ts3Fondo 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

.ts3-fase { position: relative; z-index: 1; }
.ts3-loading { position: relative; z-index: 1; }

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .ts3-titulo-pregunta { font-size: 1.6rem; }
    .ts3-icono-oraculo { font-size: 3rem; }
    .ts3-cartas-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .ts3-carta-item { padding: 1.2rem; }
    .ts3-veredicto-texto { font-size: 2rem; }
    .ts3-resultado-titulo { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .ts3-pregunta-contenido { padding: 1.5rem 0.5rem; }
    .ts3-titulo-pregunta { font-size: 1.4rem; }
    .ts3-subtitulo-pregunta { font-size: 0.85rem; }
    .ts3-input, .ts3-textarea { font-size: 0.95rem; padding: 0.8rem 1rem; }
    .ts3-btn-consultar { padding: 0.8rem 2rem; font-size: 1rem; }

    .ts3-veredicto-texto { font-size: 1.8rem; }
    .ts3-veredicto { padding: 1.5rem; }
    .ts3-interpretacion { padding: 1.2rem; }

    .ts3-carta-icono { font-size: 2.5rem; }
    .ts3-carta-nombre { font-size: 0.9rem; }
    .ts3-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
}

/* ================================================
   ACCESIBILIDAD
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    .ts3-app::before { animation: none; }
    .ts3-icono-oraculo { animation: none; }
    .ts3-destello { animation: none; display: none; }
    .ts3-loading-carta { animation: none; }
    .ts3-loading-texto { animation: none; opacity: 1; }
    .ts3-carta-item { animation: none; opacity: 1; transform: none; }
    .ts3-veredicto { animation: none; opacity: 1; transform: none; }
    .ts3-interpretacion { animation: none; opacity: 1; transform: none; }
    * { transition-duration: 0.05ms !important; animation-duration: 0.05ms !important; }
}

@media (prefers-contrast: high) {
    .ts3-carta-item { border: 2px solid rgba(255, 255, 255, 0.4); }
    .ts3-veredicto { border-width: 3px; }
    .ts3-interpretacion { border: 2px solid rgba(255, 255, 255, 0.4); }
}

@media print {
    .ts3-app::before { display: none; }
    .ts3-btn-nueva { display: none; }
    .ts3-carta-item { break-inside: avoid; }
}