/* ================================================
   ORACULO DE GEOMANCIA - APP STYLES
   ================================================ */

.ogc-app {
    --ogc-tierra: #5d4037;
    --ogc-tierra-claro: #8d6e63;
    --ogc-verde: #4caf50;
    --ogc-verde-oscuro: #2e7d32;
    --ogc-dorado: #ffd700;
    --ogc-dorado-oscuro: #d97706;
    --ogc-gradiante-tierra: linear-gradient(135deg, #5d4037 0%, #8d6e63 50%, #4caf50 100%);
    --ogc-gradiante-mistico: linear-gradient(135deg, #2e7d32 0%, #4caf50 50%, #8bc34a 100%);
    --ogc-sombra: 0 10px 30px rgba(93, 64, 55, 0.15);
    --ogc-sombra-hover: 0 15px 40px rgba(93, 64, 55, 0.25);
    --ogc-radio: 16px;
    --ogc-transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    position: relative;
    overflow: hidden;
}

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

.ogc-fase {
    animation: ogcFadeIn 0.6s ease;
}

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

.ogc-pregunta-contenido {
    text-align: center;
    padding: 2rem 1rem;
}

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

@keyframes ogcGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(76, 175, 80, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(76, 175, 80, 0.6)); }
}

.ogc-simbolo-flotante {
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: ogcSimboloFloat 3s ease-in-out infinite;
    pointer-events: none;
}

.ogc-simbolo-flotante::before { content: '⚹'; }
.ogc-sf2::before { content: '⚇'; }
.ogc-sf3::before { content: '⚃'; }

.ogc-sf2 { animation-delay: -1s; top: -10px; left: 30px; }
.ogc-sf3 { animation-delay: -2s; top: 10px; right: 20px; }

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

.ogc-titulo-pregunta {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    background: var(--ogc-gradiante-tierra);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Textarea */
.ogc-textarea-contenedor {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.ogc-pregunta-input {
    width: 100%;
    padding: 1rem 1.2rem;
    padding-bottom: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: var(--ogc-transicion);
}

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

.ogc-pregunta-input:focus {
    outline: none;
    border-color: var(--ogc-verde);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.ogc-contador {
    position: absolute;
    bottom: 8px;
    right: 14px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Tiradas */
.ogc-tiradas {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.ogc-tiradas-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.ogc-tiradas-opciones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.ogc-tirada-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--ogc-radio);
    padding: 1.2rem 0.8rem;
    cursor: pointer;
    transition: var(--ogc-transicion);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
}

.ogc-tirada-btn:hover {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.1);
    transform: translateY(-3px);
}

.ogc-tirada-btn.ogc-tirada-activa {
    border-color: var(--ogc-verde);
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
}

.ogc-tirada-icono {
    font-size: 2rem;
    line-height: 1;
}

.ogc-tirada-nombre {
    font-size: 0.95rem;
    font-weight: 600;
}

.ogc-tirada-desc {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Boton Consultar */
.ogc-btn-consultar {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--ogc-gradiante-tierra);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ogc-transicion);
    box-shadow: var(--ogc-sombra);
    font-family: inherit;
}

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

.ogc-btn-consultar:active {
    transform: translateY(0);
}

.ogc-btn-icono {
    font-size: 1.2rem;
}

/* ================================================
   FASE FIGURAS
   ================================================ */

.ogc-pregunta-mostrada {
    text-align: center;
    color: var(--ogc-dorado);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.ogc-instruccion-figuras {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Figuras */
.ogc-figuras-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 2rem 0;
    perspective: 1000px;
}

.ogc-figuras-area.ogc-figuras-escudo {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem 0;
}

.ogc-figura-contenedor {
    width: 130px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
}

.ogc-figuras-area.ogc-figuras-escudo .ogc-figura-contenedor {
    width: 120px;
    height: 180px;
}

.ogc-figura-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.ogc-figura-contenedor.ogc-revelada .ogc-figura-inner {
    transform: rotateY(180deg);
}

.ogc-figura-frente,
.ogc-figura-reverso {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Reverso de la figura */
.ogc-figura-reverso {
    background: var(--ogc-gradiante-mistico);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.ogc-figura-reverso::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
}

.ogc-figura-reverso::after {
    content: '⚹';
    font-size: 2.5rem;
    color: rgba(255, 215, 0, 0.3);
    position: absolute;
}

.ogc-figura-reverso .ogc-figura-patron {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
}

.ogc-figura-reverso .ogc-figura-posicion {
    position: absolute;
    bottom: 10px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    width: 100%;
    padding: 0 6px;
}

/* Hover figura boca abajo */
.ogc-figura-contenedor:not(.ogc-revelada):hover .ogc-figura-inner {
    transform: translateY(-8px);
}

.ogc-figura-contenedor:not(.ogc-revelada):hover .ogc-figura-reverso {
    box-shadow: 0 15px 35px rgba(46, 125, 50, 0.4);
    border-color: rgba(255, 215, 0, 0.4);
}

/* Frente de la figura */
.ogc-figura-frente {
    background: rgba(20, 15, 30, 0.95);
    border: 2px solid rgba(76, 175, 80, 0.4);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.2);
    transform: rotateY(180deg);
    padding: 0.8rem 0.5rem;
}

.ogc-figura-frente.ogc-figura-invertida {
    border-color: rgba(206, 17, 38, 0.5);
    box-shadow: 0 8px 25px rgba(206, 17, 38, 0.2);
}

.ogc-figura-simbolo {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.ogc-figura-frente .ogc-figura-nombre {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    font-style: italic;
}

.ogc-figura-orientacion {
    font-size: 0.65rem;
    margin-top: 0.2rem;
    font-style: italic;
}

.ogc-figura-orientacion.ogc-invertida-texto {
    color: #ce1126;
}

.ogc-figura-orientacion.ogc-derecha-texto {
    color: #22c55e;
}

/* Progreso */
.ogc-progreso {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 1rem;
}

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

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

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

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

.ogc-resultado-figuras {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ogc-resultado-figura {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--ogc-radio);
    padding: 1.5rem;
    animation: ogcSlideIn 0.5s ease;
    animation-fill-mode: both;
}

.ogc-resultado-figura:nth-child(1) { animation-delay: 0.1s; }
.ogc-resultado-figura:nth-child(2) { animation-delay: 0.25s; }
.ogc-resultado-figura:nth-child(3) { animation-delay: 0.4s; }
.ogc-resultado-figura:nth-child(4) { animation-delay: 0.55s; }

@keyframes ogcSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.ogc-resultado-figura-posicion {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ogc-dorado);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.ogc-resultado-figura-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ogc-resultado-figura-simbolo {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.ogc-resultado-figura-info h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    font-style: italic;
}

.ogc-resultado-figura-info .ogc-orientacion-badge {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
}

.ogc-orientacion-badge.ogc-badge-derecha {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.ogc-orientacion-badge.ogc-badge-invertida {
    background: rgba(206, 17, 38, 0.2);
    color: #ef4444;
}

.ogc-resultado-figura-significado {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.ogc-resultado-figura-consejo {
    background: rgba(255, 215, 0, 0.08);
    border-left: 3px solid var(--ogc-dorado);
    padding: 0.8rem 1rem;
    border-radius: 0 8px 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-style: italic;
}

.ogc-resultado-figura-consejo::before {
    content: '🌍 ';
}

/* Consejo final */
.ogc-resultado-consejo {
    margin-top: 2rem;
    text-align: center;
    padding: 2rem;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--ogc-radio);
}

.ogc-resultado-consejo h3 {
    color: var(--ogc-dorado);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.ogc-resultado-consejo p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

/* Boton nueva consulta */
.ogc-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, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ogc-transicion);
    margin-top: 2rem;
    font-family: inherit;
}

.ogc-btn-nueva:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: var(--ogc-verde);
    transform: translateY(-2px);
}

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

.ogc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    min-height: 300px;
}

.ogc-loading-figuras {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ogc-loading-figura {
    width: 50px;
    height: 75px;
    background: var(--ogc-gradiante-mistico);
    border-radius: 8px;
    animation: ogcBarajar 1.2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ogc-lf2 { animation-delay: 0.2s; }
.ogc-lf3 { animation-delay: 0.4s; }

@keyframes ogcBarajar {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(-5deg); }
    75% { transform: translateY(5px) rotate(3deg); }
}

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

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

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

.ogc-app::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(93, 64, 55, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(76, 175, 80, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(255, 215, 0, 0.04) 0%, transparent 50%);
    animation: ogcFondo 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

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

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

@media (max-width: 768px) {
    .ogc-titulo-pregunta { font-size: 1.4rem; }
    .ogc-icono-geo { font-size: 3rem; }
    .ogc-figura-contenedor { width: 110px; height: 170px; }
    .ogc-figuras-area.ogc-figuras-escudo .ogc-figura-contenedor { width: 90px; height: 140px; }
    .ogc-figura-simbolo { font-size: 2rem; }
    .ogc-figura-frente .ogc-figura-nombre { font-size: 0.7rem; }
    .ogc-resultado-figura { padding: 1.2rem; }
    .ogc-figuras-area { gap: 1rem; }
}

@media (max-width: 480px) {
    .ogc-pregunta-contenido { padding: 1rem 0.5rem; }
    .ogc-titulo-pregunta { font-size: 1.2rem; }
    .ogc-subtitulo-pregunta { font-size: 0.85rem; }
    .ogc-tiradas-opciones { grid-template-columns: 1fr; gap: 0.7rem; }
    .ogc-tirada-btn { flex-direction: row; padding: 0.8rem 1rem; gap: 0.6rem; }
    .ogc-tirada-icono { font-size: 1.5rem; }
    .ogc-figura-contenedor { width: 95px; height: 145px; }
    .ogc-figuras-area { gap: 0.6rem; }
    .ogc-figuras-area.ogc-figuras-escudo .ogc-figura-contenedor { width: 75px; height: 115px; }
    .ogc-figura-simbolo { font-size: 1.5rem; }
    .ogc-figura-frente .ogc-figura-nombre { font-size: 0.65rem; }
    .ogc-btn-consultar { padding: 0.8rem 1.8rem; font-size: 1rem; }
    .ogc-resultado-titulo { font-size: 1.4rem; }
    .ogc-resultado-figura-simbolo { width: 45px; height: 45px; font-size: 1.8rem; }
    .ogc-resultado-figura-info h3 { font-size: 1rem; }
    .ogc-resultado-figura-header { gap: 0.7rem; }
}

@media (max-width: 360px) {
    .ogc-figura-contenedor { width: 80px; height: 125px; }
    .ogc-figuras-area { gap: 0.4rem; }
}

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

@media (prefers-reduced-motion: reduce) {
    .ogc-app::before { animation: none; }
    .ogc-icono-geo { animation: none; }
    .ogc-simbolo-flotante { animation: none; display: none; }
    .ogc-loading-figura { animation: none; }
    .ogc-loading-texto { animation: none; opacity: 1; }
    .ogc-figura-inner { transition-duration: 0.01ms; }
    .ogc-resultado-figura { animation: none; opacity: 1; transform: none; }
    * { transition-duration: 0.05ms !important; animation-duration: 0.05ms !important; }
}

@media (prefers-contrast: high) {
    .ogc-figura-reverso { border: 3px solid white; }
    .ogc-figura-frente { border: 3px solid white; }
    .ogc-tirada-btn { border: 2px solid white; }
    .ogc-tirada-btn.ogc-tirada-activa { border-color: var(--ogc-verde); }
    .ogc-resultado-figura { border: 2px solid rgba(255, 255, 255, 0.5); }
}

/* Print */
@media print {
    .ogc-app::before { display: none; }
    .ogc-btn-consultar, .ogc-btn-nueva { display: none; }
    .ogc-resultado-figura { break-inside: avoid; }
}
