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

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

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

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

.ts5-fase {
    animation: ts5FadeIn 0.6s ease;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

.ts5-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(--ts5-transicion);
    box-sizing: border-box;
}

.ts5-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(--ts5-transicion);
    box-sizing: border-box;
    min-height: 100px;
    resize: vertical;
}

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

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

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

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

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

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

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

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

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

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

.ts5-loading-carta {
    width: 50px;
    height: 75px;
    background: var(--ts5-gradiente-mistico);
    border-radius: 10px;
    animation: ts5Barajar 1.6s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(26, 39, 68, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.15);
}

.ts5-loading-carta-2 { animation-delay: -0.2s; }
.ts5-loading-carta-3 { animation-delay: -0.4s; }
.ts5-loading-carta-4 { animation-delay: -0.6s; }
.ts5-loading-carta-5 { animation-delay: -0.8s; }

@keyframes ts5Barajar {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    20% { transform: translateY(-20px) rotate(-7deg); }
    40% { transform: translateY(-3px) rotate(5deg); }
    60% { transform: translateY(-14px) rotate(-3deg); }
    80% { transform: translateY(-6px) rotate(4deg); }
}

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

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

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

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

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

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

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

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

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

.ts5-carta-item:nth-child(2) { animation-delay: 0.08s; animation-fill-mode: both; }
.ts5-carta-item:nth-child(3) { animation-delay: 0.16s; animation-fill-mode: both; }
.ts5-carta-item:nth-child(4) { animation-delay: 0.24s; animation-fill-mode: both; }
.ts5-carta-item:nth-child(5) { animation-delay: 0.32s; animation-fill-mode: both; }

.ts5-carta-item:hover {
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 5px 20px rgba(26, 39, 68, 0.25);
    transform: translateY(-3px);
}

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

.ts5-carta-posicion {
    font-size: 0.7rem;
    color: var(--ts5-dorado);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.ts5-carta-icono {
    font-size: 2.5rem;
    margin-bottom: 0.4rem;
    display: block;
}

.ts5-carta-nombre {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.ts5-carta-significado {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
    line-height: 1.4;
}

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

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

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

.ts5-veredicto-conteo {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.8rem;
}

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

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

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

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

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

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

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

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

.ts5-interpretacion-texto {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    border-left: 3px solid rgba(255, 215, 0, 0.2);
}

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

/* Boton nueva consulta */
.ts5-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(--ts5-transicion);
    margin-top: 1rem;
    font-family: inherit;
}

.ts5-btn-nueva:hover {
    background: rgba(26, 39, 68, 0.3);
    border-color: var(--ts5-dorado);
    transform: translateY(-2px);
}

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

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

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

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

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

@media (max-width: 992px) {
    .ts5-cartas-grid { grid-template-columns: repeat(3, 1fr); }
}

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

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

    .ts5-cartas-grid { grid-template-columns: 1fr; gap: 0.6rem; }
    .ts5-carta-item { padding: 0.8rem; }
    .ts5-carta-icono { font-size: 2rem; }
    .ts5-carta-nombre { font-size: 0.8rem; }

    .ts5-veredicto-texto { font-size: 1.8rem; }
    .ts5-veredicto { padding: 1.5rem; }
    .ts5-interpretacion { padding: 1.2rem; }
    .ts5-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
}

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

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

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

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