/* ================================================
   I CHING DEL AMOR - APP STYLES
   ================================================ */

.ich-app {
    --ich-oro: #d4af37;
    --ich-rojo: #dc143c;
    --ich-negro: #2c2c2c;
    --ich-jade: #2ecc71;
    --ich-gradiente: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #ffed4e 100%);
    --ich-gradiente-rojo: linear-gradient(135deg, #dc143c 0%, #d4af37 50%, #dc143c 100%);
    --ich-sombra: 0 10px 30px rgba(212, 175, 55, 0.15);
    --ich-sombra-hover: 0 15px 40px rgba(212, 175, 55, 0.25);
    --ich-radio: 16px;
    --ich-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

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

.ich-fase {
    animation: ichFadeIn 0.6s ease;
}

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

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

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

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

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

.ich-destello::before { content: '\2726'; }
.ich-d2::before { content: '\2756'; }
.ich-d3::before { content: '\2727'; }

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

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

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

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

/* Tirada buttons */
.ich-tirada-opciones {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.ich-tirada-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 1.2rem 0.8rem;
    color: #fff;
    cursor: pointer;
    transition: var(--ich-transicion);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
}

.ich-tirada-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--ich-oro);
    transform: translateY(-3px);
    box-shadow: var(--ich-sombra);
}

.ich-tirada-btn.ich-tirada-btn-active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--ich-oro);
    box-shadow: var(--ich-sombra);
}

.ich-tirada-icono {
    font-size: 2rem;
}

.ich-tirada-nombre {
    font-size: 0.9rem;
    font-weight: 600;
}

.ich-tirada-desc {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Pregunta textarea */
.ich-pregunta-area {
    margin-bottom: 1.5rem;
}

.ich-pregunta-label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.ich-pregunta-input {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: var(--ich-transicion);
}

.ich-pregunta-input:focus {
    outline: none;
    border-color: var(--ich-oro);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.ich-pregunta-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ich-instruccion {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

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

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

.ich-loading-monedas {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ich-moneda {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--ich-gradiente);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    animation: ichMoneda 1.5s ease-in-out infinite;
    position: relative;
}

.ich-moneda::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(44, 44, 44, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.ich-m2 { animation-delay: 0.2s; }
.ich-m3 { animation-delay: 0.4s; }

@keyframes ichMoneda {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(5px) rotate(180deg); }
    75% { transform: translateY(-10px) rotate(270deg); }
}

.ich-loading-texto {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    animation: ichPulso 1.5s ease-in-out infinite;
}

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

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

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

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

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

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

.ich-resultado-hexagramas {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ich-resultado-hex {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--ich-radio);
    padding: 2rem;
    animation: ichSlideIn 0.6s ease both;
}

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

.ich-hex-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.ich-hex-visual {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.ich-hexagrama-lineas {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ich-linea {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.ich-linea-solida {
    width: 60px;
    height: 6px;
    background: var(--ich-oro);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.ich-linea-rota {
    width: 60px;
    height: 6px;
}

.ich-linea-rota span {
    width: 24px;
    height: 6px;
    background: var(--ich-oro);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.ich-hex-numero {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.2rem;
}

.ich-hex-simbolo {
    font-size: 1.5rem;
}

.ich-hex-info h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.ich-elem-badge {
    font-size: 0.8rem;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-block;
}

.ich-badge-cielo { background: rgba(212, 175, 55, 0.2); color: #ffd700; }
.ich-badge-tierra { background: rgba(46, 204, 113, 0.2); color: #4ade80; }
.ich-badge-fuego { background: rgba(220, 20, 60, 0.2); color: #f87171; }
.ich-badge-agua { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.ich-badge-trueno { background: rgba(255, 165, 0, 0.2); color: #ffa500; }
.ich-badge-viento { background: rgba(0, 206, 209, 0.2); color: #00ced1; }
.ich-badge-lago { background: rgba(100, 200, 255, 0.2); color: #64c8ff; }
.ich-badge-montana { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.ich-hex-posicion {
    color: var(--ich-oro);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--ich-oro);
}

.ich-hex-mensaje {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.ich-hex-consejo {
    background: rgba(212, 175, 55, 0.08);
    border-left: 3px solid var(--ich-oro);
    padding: 1rem 1.2rem;
    border-radius: 0 10px 10px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-style: italic;
}

.ich-hex-consejo::before { content: '\1F4DC  '; }

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

.ich-btn-nueva:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--ich-oro);
    transform: translateY(-2px);
}

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

.ich-app::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(220, 20, 60, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    animation: ichFondo 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .ich-tirada-opciones {
        grid-template-columns: repeat(2, 1fr);
    }

    .ich-titulo-pregunta { font-size: 1.6rem; }
    .ich-icono-oraculo { font-size: 3rem; }

    .ich-resultado-hex { padding: 1.5rem; }
    .ich-hex-header { gap: 1rem; }
    .ich-hex-visual { width: 70px; }
    .ich-linea-solida { width: 50px; }
    .ich-linea-rota { width: 50px; }
    .ich-linea-rota span { width: 20px; }
}

@media (max-width: 480px) {
    .ich-pregunta-contenido { padding: 1.5rem 0.5rem; }
    .ich-titulo-pregunta { font-size: 1.4rem; }
    .ich-subtitulo-pregunta { font-size: 0.85rem; }
    .ich-tirada-opciones { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
    .ich-tirada-btn { padding: 0.8rem 0.5rem; }
    .ich-tirada-icono { font-size: 1.5rem; }
    .ich-tirada-nombre { font-size: 0.8rem; }

    .ich-resultado-hex { padding: 1.2rem; }
    .ich-hex-header { flex-direction: column; text-align: center; }
    .ich-hex-visual { width: auto; flex-direction: row; gap: 1rem; }
    .ich-hexagrama-lineas { flex-direction: row; margin-bottom: 0; }
    .ich-linea-solida { width: 40px; height: 5px; }
    .ich-linea-rota { width: 40px; height: 5px; }
    .ich-linea-rota span { width: 16px; height: 5px; }
    .ich-hex-info h3 { font-size: 1.1rem; }
    .ich-btn-nueva { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
}

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

@media (prefers-reduced-motion: reduce) {
    .ich-app::before { animation: none; }
    .ich-icono-oraculo { animation: none; }
    .ich-destello { animation: none; display: none; }
    .ich-moneda { animation: none; }
    .ich-loading-texto { animation: none; opacity: 1; }
    .ich-resultado-hex { animation: none; opacity: 1; transform: none; }
    * { transition-duration: 0.05ms !important; animation-duration: 0.05ms !important; }
}

@media (prefers-contrast: high) {
    .ich-resultado-hex { border: 2px solid rgba(255, 255, 255, 0.5); }
    .ich-linea-solida, .ich-linea-rota span { background: #ffd700; }
}

@media print {
    .ich-app::before { display: none; }
    .ich-btn-nueva { display: none; }
    .ich-resultado-hex { break-inside: avoid; }
}