/* ================================================
   TAROT POKER - APP STYLES
   Casino Theme: Red / Black / Gold
   ================================================ */

.tpk-app {
    --tpk-rojo: #cc0000;
    --tpk-rojo-oscuro: #8b0000;
    --tpk-rojo-claro: #ff3333;
    --tpk-negro: #1a1a1a;
    --tpk-negro-claro: #2a2a2a;
    --tpk-dorado: #d4a017;
    --tpk-dorado-claro: #f0c040;
    --tpk-dorado-oscuro: #b8860b;
    --tpk-blanco: #f5f0e8;
    --tpk-crema: #e8dcc8;
    --tpk-gradiente-rojo: linear-gradient(135deg, #1a1a1a 0%, #2a0000 50%, #3a0000 100%);
    --tpk-gradiente-dorado: linear-gradient(135deg, #b8860b 0%, #d4a017 50%, #f0c040 100%);
    --tpk-sombra: 0 10px 30px rgba(212, 160, 23, 0.15);
    --tpk-radio: 16px;
    --tpk-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

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

.tpk-fase {
    animation: tpkFadeIn 0.6s ease;
}

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

/* ================================================
   FASE FORMULARIO
   ================================================ */

.tpk-form-contenido {
    text-align: center;
    padding: 2.5rem 1rem;
}

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

@keyframes tpkGirada {
    0%, 100% { transform: rotateY(0deg) scale(1); filter: brightness(1); }
    25% { transform: rotateY(90deg) scale(0.9); filter: brightness(0.8); }
    50% { transform: rotateY(180deg) scale(1); filter: brightness(1.2) drop-shadow(0 0 15px rgba(212, 160, 23, 0.5)); }
    75% { transform: rotateY(270deg) scale(0.9); filter: brightness(0.8); }
}

.tpk-carta-brillos {
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: tpkDestello 3s ease-in-out infinite;
    pointer-events: none;
}

.tpk-cb1::before { content: '\2726'; color: var(--tpk-dorado); }
.tpk-cb2::before { content: '\2660'; color: var(--tpk-rojo); }
.tpk-cb3::before { content: '\2727'; color: var(--tpk-dorado); }

.tpk-cb1 { animation-delay: -0.5s; top: -10px; left: 10px; }
.tpk-cb2 { animation-delay: -1.5s; top: -5px; right: 5px; }
.tpk-cb3 { animation-delay: -2.5s; bottom: 0px; left: 25px; }

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

.tpk-titulo-form {
    color: var(--tpk-blanco);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--tpk-gradiente-dorado);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tpk-subtitulo-form {
    color: rgba(245, 240, 232, 0.7);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.tpk-form-campo {
    max-width: 500px;
    margin: 0 auto 1rem;
    text-align: left;
}

.tpk-form-seccion {
    margin-bottom: 1.5rem;
}

.tpk-seccion-label {
    color: rgba(245, 240, 232, 0.7);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.tpk-input,
.tpk-textarea {
    width: 100%;
    background: rgba(245, 240, 232, 0.05);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    color: var(--tpk-blanco);
    font-family: inherit;
    font-size: 1.05rem;
    transition: var(--tpk-transicion);
    box-sizing: border-box;
}

.tpk-textarea {
    min-height: 100px;
    resize: vertical;
}

.tpk-input:focus,
.tpk-textarea:focus {
    outline: none;
    border-color: var(--tpk-dorado);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
    background-color: rgba(245, 240, 232, 0.08);
}

.tpk-input::placeholder,
.tpk-textarea::placeholder {
    color: rgba(245, 240, 232, 0.35);
}

.tpk-select {
    width: 100%;
    background: rgba(245, 240, 232, 0.05);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--tpk-blanco);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--tpk-transicion);
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23d4a017' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.tpk-select:focus {
    outline: none;
    border-color: var(--tpk-dorado);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
    background-color: rgba(245, 240, 232, 0.08);
}

.tpk-select option {
    background: var(--tpk-negro);
    color: var(--tpk-blanco);
}

.tpk-btn-consultar {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--tpk-gradiente-dorado);
    color: var(--tpk-negro);
    border: none;
    border-radius: 50px;
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--tpk-transicion);
    margin-top: 1.5rem;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tpk-btn-consultar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 160, 23, 0.3);
}

.tpk-instruccion {
    color: rgba(245, 240, 232, 0.5);
    font-size: 0.85rem;
    margin-top: 1.5rem;
}

/* ================================================
   LOADING - CARD SHUFFLE ANIMATION
   ================================================ */

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

.tpk-loading-cartas {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    height: 100px;
    align-items: center;
}

.tpk-carta-animada {
    font-size: 2.5rem;
    animation: tpkMezclar 1.5s ease-in-out infinite;
}

.tpk-ca1 { animation-delay: 0s; }
.tpk-ca2 { animation-delay: 0.15s; }
.tpk-ca3 { animation-delay: 0.3s; }
.tpk-ca4 { animation-delay: 0.45s; }

@keyframes tpkMezclar {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    25% { transform: translateY(-30px) rotate(10deg) scale(0.9); opacity: 0.7; }
    50% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    75% { transform: translateY(20px) rotate(-10deg) scale(0.9); opacity: 0.7; }
}

.tpk-loading-texto {
    color: rgba(245, 240, 232, 0.7);
    font-size: 1rem;
    animation: tpkPulsoTexto 1.5s ease-in-out infinite;
}

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

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

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

.tpk-seccion {
    background: rgba(245, 240, 232, 0.05);
    border: 1px solid rgba(212, 160, 23, 0.12);
    border-radius: var(--tpk-radio);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: tpkSlideIn 0.6s ease both;
}

.tpk-seccion:nth-child(1) { animation-delay: 0s; }
.tpk-seccion:nth-child(2) { animation-delay: 0.1s; }
.tpk-seccion:nth-child(3) { animation-delay: 0.2s; }

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

.tpk-seccion-titulo {
    color: var(--tpk-dorado);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ================================================
   HEADER CARD
   ================================================ */

.tpk-header-info {
    text-align: center;
}

.tpk-header-nombre {
    color: var(--tpk-dorado);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.tpk-header-pregunta {
    color: rgba(245, 240, 232, 0.7);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.tpk-header-tipo {
    color: var(--tpk-rojo-claro);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    background: rgba(204, 0, 0, 0.15);
    border: 1px solid rgba(204, 0, 0, 0.25);
    border-radius: 20px;
    padding: 0.3rem 1rem;
}

/* ================================================
   CARTA INDIVIDUAL
   ================================================ */

.tpk-cartas-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.tpk-carta-item {
    background: rgba(245, 240, 232, 0.05);
    border: 2px solid rgba(212, 160, 23, 0.2);
    border-radius: 14px;
    padding: 1.5rem 1rem;
    flex: 1 1 180px;
    max-width: 220px;
    text-align: center;
    animation: tpkSlideIn 0.6s ease both;
    transition: var(--tpk-transicion);
}

.tpk-carta-item:hover {
    border-color: var(--tpk-dorado);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(212, 160, 23, 0.15);
}

.tpk-carta-item:nth-child(1) { animation-delay: 0.05s; }
.tpk-carta-item:nth-child(2) { animation-delay: 0.1s; }
.tpk-carta-item:nth-child(3) { animation-delay: 0.15s; }
.tpk-carta-item:nth-child(4) { animation-delay: 0.2s; }
.tpk-carta-item:nth-child(5) { animation-delay: 0.25s; }

.tpk-carta-palo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tpk-carta-palo.rojo { color: var(--tpk-rojo-claro); }
.tpk-carta-palo.negro { color: var(--tpk-blanco); }

.tpk-carta-valor {
    color: var(--tpk-dorado);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.tpk-carta-nombre-palo {
    color: rgba(245, 240, 232, 0.6);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.tpk-carta-significado {
    color: rgba(245, 240, 232, 0.8);
    font-size: 0.85rem;
    line-height: 1.5;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(212, 160, 23, 0.15);
}

/* ================================================
   INTERPRETACION
   ================================================ */

.tpk-interpretacion-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(212, 160, 23, 0.06);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: 12px;
    padding: 1rem;
}

.tpk-interpretacion-icon {
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--tpk-dorado);
}

.tpk-interpretacion-text {
    color: rgba(245, 240, 232, 0.85);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ================================================
   NUEVA CONSULTA
   ================================================ */

.tpk-btn-nueva {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(245, 240, 232, 0.08);
    color: var(--tpk-blanco);
    border: 2px solid rgba(212, 160, 23, 0.3);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--tpk-transicion);
    font-family: inherit;
}

.tpk-btn-nueva:hover {
    background: rgba(212, 160, 23, 0.15);
    border-color: var(--tpk-dorado);
    transform: translateY(-2px);
}

/* ================================================
   FONDO
   ================================================ */

.tpk-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(26, 26, 26, 0.9) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(212, 160, 23, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(204, 0, 0, 0.03) 0%, transparent 50%);
    animation: tpkFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .tpk-titulo-form { font-size: 1.6rem; }
    .tpk-icono-oraculo { font-size: 3rem; }
    .tpk-cartas-container { flex-direction: column; align-items: center; }
    .tpk-carta-item { flex: 1 1 100%; max-width: 280px; }
}

@media (max-width: 480px) {
    .tpk-form-contenido { padding: 1.5rem 0.5rem; }
    .tpk-titulo-form { font-size: 1.4rem; }
    .tpk-subtitulo-form { font-size: 0.85rem; }
    .tpk-resultado-contenido { padding: 1.5rem 0.5rem; }
    .tpk-seccion { padding: 1.2rem; }
    .tpk-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .tpk-btn-consultar { padding: 0.8rem 1.8rem; font-size: 0.9rem; }
}

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

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

@media (prefers-contrast: high) {
    .tpk-seccion { border: 2px solid rgba(245, 240, 232, 0.4); }
    .tpk-input { border: 2px solid rgba(245, 240, 232, 0.4); }
    .tpk-select { border: 2px solid rgba(245, 240, 232, 0.4); }
}

@media print {
    .tpk-app::before { display: none; }
    .tpk-btn-nueva { display: none; }
    .tpk-seccion { break-inside: avoid; }
}
