/* Flashcard Deck - Rough Stack & Overlay */
.flash-deck-container {
    position: relative;
    width: 100%;
    max-width: 680px;
    /* Editorial Standard: 680px */
    height: 480px;
    /* Increased Height for better proportion with 680px */
    /* Shorter than width */
    margin: 40px auto 80px auto;
    perspective: 1200px;
    z-index: 5;
}

.flash-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    /* Theme Var */
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    /* Theme Var */
    /* Subtle shadow initially */
    overflow: hidden;
    overflow: hidden;
    transition: transform 0.5s ease, opacity 0.5s ease;
    /* Removed complex bezier to reduce 'jumpiness' */
    transform-origin: center bottom;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Limit content to top and bottom */
}

/* FULL IMAGE BACKGROUND */
.flash-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.flash-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Card Internal Content --- */
.flash-card-top {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.flash-card-title {
    font-family: 'Lora', serif;
    font-size: 1rem;
    /* Small */
    color: var(--text-glass);
    background: var(--bg-glass);
    padding: 5px 12px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

/* BOTTOM DESCRIPTION (Fade Up) */
.flash-card-content {
    position: relative;
    z-index: 2;
    margin-top: auto;
    /* Push to bottom */
    padding: 40px 20px 25px 20px;
    background: linear-gradient(to top, var(--bg-glass) 40%, rgba(0, 0, 0, 0) 100%);
    /* Glass fade upwards */
}

.flash-card-content p {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    /* Very small */
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Hidden elements if structure changes */
.flash-card-content h3 {
    display: none;
    /* We will move title to top in HTML or use this if we can't move */
}


/* POSITIONS - ROUGH STACK */

/* 0: Active */
.flash-card.pos-0 {
    z-index: 10;
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* 1: Roughly Behind Right */
.flash-card.pos-1 {
    z-index: 9;
    opacity: 1;
    transform: translateX(15px) translateY(5px) rotate(3deg) scale(0.98);
    filter: grayscale(0.2);
}

/* 2: Roughly Behind Left/Center */
.flash-card.pos-2 {
    z-index: 8;
    opacity: 1;
    transform: translateX(-10px) translateY(10px) rotate(-2deg) scale(0.96);
    filter: grayscale(0.4);
}

/* 3: Roughly Behind More */
.flash-card.pos-3 {
    z-index: 7;
    opacity: 1;
    transform: translateX(5px) translateY(15px) rotate(1deg) scale(0.94);
    filter: grayscale(0.6);
}

/* 4: Hidden Stack */
.flash-card.pos-4 {
    z-index: 0;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
}

/* EXIT ANIMATIONS */
.flash-card.pos-exit {
    opacity: 0;
    transform: translateX(-150%) rotate(-20deg) scale(0.8);
    /* Sideways fly out */
}