/* styles/oracle.css */

/* 1. HUGE CARD CONTAINER */
.flip-card {
    background-color: transparent;
    /* Base massive size (2:3 aspect ratio based on 2480x3720) */
    width: 600px;
    height: 900px;
    
    /* Responsive constraint: prevent it from being larger than the viewport */
    max-width: 90vw;
    max-height: 85vh; 
    aspect-ratio: 2 / 3;
    
    perspective: 1000px;
    cursor: pointer;
    margin: 0 auto; 
}

/* Inner Container */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* FLIP LOGIC FIXED: */
/* When .flipped is added, we rotate 180deg to show the "Front" (Image) */
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* Front & Back Common Styles */
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Important: Hides the reverse side */
    border-radius: 20px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    overflow: hidden; 
}

/* THE BACK (Gold Star/Pattern)
   Starts at 0deg (Visible by default before flip)
*/
.flip-card-back {
    background-color: #b08a48 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotateY(0deg); /* CORRECTED: Visible start */
    border: 4px solid #fff;
    z-index: 2; /* Ensures it sits on top initially */
}

/* THE FRONT (Image & Text)
   Starts at 180deg (Hidden behind the back initially)
*/
.flip-card-front {
    background-color: #000;
    transform: rotateY(180deg); /* CORRECTED: Hidden start */
    padding: 0;
}

/* The Image: Absolute Full Fill */
.card-image-full {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
}

/* The Overlay: Text on top of image at bottom */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    
    /* Dark gradient fade so text is readable */
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    color: #fff;
    
    padding: 40px 20px 30px 20px; 
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Typography */
.card-overlay h5 {
    font-family: serif; 
    font-size: 2rem;
    color: #b08a48; /* Gold text */
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.card-overlay p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #eee;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Placeholder adjustments */
#cardPlaceholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #b08a48;
    background: rgba(176, 138, 72, 0.05);
    border-radius: 20px;
}