
/* CARD COMPONENT */


.card { 
    display: inline-flex; 
    flex-direction: column;
    
    background-image: url('../Images/paper.jpg'); 
    background-size: cover;
    background-position: center;
    
    border: 2px solid #222; 
    border-radius: 8px; 
    width: 220px; 
    height: 320px; 
    margin: 10px; 
    cursor: pointer; 
    box-shadow: 4px 4px 12px rgba(0,0,0,0.8);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    overflow: hidden; 
    text-align: left;
    color: #111; 

    -webkit-text-stroke: 0.5px #111; 
    text-shadow: 0px 0px 1px rgba(17, 17, 17, 0.8); 
}


.card:hover { 
    transform: scale(1.05); 
    border-color: #000; 
    box-shadow: 6px 6px 15px rgba(0,0,0,0.9);
}


.enemy-card { 
    cursor: default; 
}
.enemy-card:hover { 
    transform: none; 
    border-color: #222; 
    box-shadow: 4px 4px 12px rgba(0,0,0,0.8);
}

/* internal card grid */
.card-header {
    display: flex;
    border-bottom: 2px solid #222;
    height: 40px;
    align-items: center;
}
.card-type {
    width: 30%;
    border-right: 2px solid #222;
    padding: 5px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
    color: #8b0000; 
}
.card-name {
    width: 70%;
    padding: 5px;
    font-size: 14px;
    font-weight: bold;
    color: #000; 
}

.card-body {
    display: flex;
    flex: 1; 
    min-height: 0; 
}

.card-stats {
    width: 30%;
    border-right: 2px solid #222;
    display: flex;
    flex-direction: column;
}
.stat-row {
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #444;
}
.stat-row:last-child { border-bottom: none; } 
.stat-label { font-size: 10px; color: #444; font-weight: bold; }
.stat-value { 
    font-size: 16px; 
    font-weight: bold; 
    color: #000;
    
    
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    line-height: 1; 
}

.card-text-zone {
    width: 70%;
    display: flex;
    flex-direction: column;
    min-height: 0; 
}
.card-desc {
    flex: 1;
    border-bottom: 2px solid #222;
    padding: 8px;
    font-size: 12px;
    font-style: italic;
    font-weight: bold;
    color: #222;
    min-height: 0; 
    overflow-y: auto; 
}
.card-effect {
    flex: 1;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    color: #222;
    min-height: 0;
    overflow-y: auto; 
}


/* scrollbar */

.card-desc::-webkit-scrollbar,
.card-effect::-webkit-scrollbar {
    width: 4px; 
}
.card-desc::-webkit-scrollbar-track,
.card-effect::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05); 
    border-radius: 4px;
}
.card-desc::-webkit-scrollbar-thumb,
.card-effect::-webkit-scrollbar-thumb {
    background: #444; 
    border-radius: 4px;
}
.card-desc::-webkit-scrollbar-thumb:hover,
.card-effect::-webkit-scrollbar-thumb:hover {
    background: #8b0000; 
}



/* mini card*/


.mini-card {
    transform: scale(0.7);
    transform-origin: top center; 
    margin: 0px -45px -112px -45px !important; 
}


#p1-hand .mini-card:hover {
    transform: scale(0.75) translateY(-10px);
    z-index: 10;
    margin: 0px 10px -112px 10px !important; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.9);
}

#p2-hand .mini-card:hover {
    transform: scale(0.65); 
    z-index: 1;
    margin: 0px -45px -112px -45px !important; /* Stays identical to default */
}


.card-sub-header {
    display: flex;
    border-bottom: 2px solid #222;
    min-height: 25px; 
    height: auto;
    align-items: center;
    font-size: 8px;
    font-weight: bold;
    text-align: center;
    color: #000; 
}

.card-soul {
    flex: 1; 
    border-right: 2px solid #222;
    padding: 4px 2px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-lineage {
    flex: 2; 
    padding: 4px 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.2; 
}


.arrow-tag {
    /* Red wax seal style */
    background-color: #8b0000; 
    color: #f4ecd8; 
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 0.5px;
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 4px; /* Tweaked to 4px to give the number nice breathing room */
    border: 1px solid #3e0c0c;
    text-transform: uppercase;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1; 
    white-space: nowrap; 

    /* 🛑 Overrides the global text thickening so this tiny tag remains readable */
    -webkit-text-stroke: 0px; 
    text-shadow: none; 
}


/* card back*/

.card-back {
    display: inline-flex; 
    flex-direction: column;
    width: 220px; 
    height: 320px; 
    margin: 10px; 
    border-radius: 8px;
    border: 2px solid #222;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.8);
    

    background-image: url('../Images/Leather-compress.jpg'); 
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    position: relative; 
    overflow: hidden;
}

.card-back:hover {
    transform: scale(1.05);
    border-color: #000;
}

.card-back::before {
    content: "?";
    font-family: "Uncial Antiqua", cursive;
    position: absolute;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    font-size: 140px;
    font-weight: bold;

    color: rgba(255, 255, 255, 0.2); 

    text-shadow:
        0 0 10px rgba(0,0,0,0.3),
        2px 2px 4px rgba(0,0,0,0.4);

    pointer-events: none;
    
}

.mini-card:hover {
    transform: scale(0.8);
}

/* animations */




@keyframes damage-shake {
    0%, 100% { transform: translateX(0); filter: drop-shadow(0 0 0 rgba(255,0,0,0)); }
    20%, 60% { transform: translateX(-8px) rotate(-2deg); filter: drop-shadow(0 0 15px red); border-color: red; }
    40%, 80% { transform: translateX(8px) rotate(2deg); filter: drop-shadow(0 0 15px red); border-color: red; }
}

.anim-damage {
    animation: damage-shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    transition: none !important; 
    z-index: 50; 
}



@keyframes summon-slam {
    0% { 
        transform: scale(1.15) translateY(-15px); 
        opacity: 0; 
        box-shadow: 0 15px 25px rgba(0,0,0,0.6); 
    }
    70% { 
        transform: scale(0.99) translateY(1px); 
        opacity: 1; 
        box-shadow: 0 4px 8px rgba(0,0,0,0.8); 
    }
    100% { 
        transform: scale(1) translateY(0); 
        opacity: 1; 
    }
}

.anim-summon {
    animation: summon-slam 0.3s ease-out both; 
    transition: none !important;
    z-index: 50;
}



@keyframes card-draw-left {
    0% { 
        transform: translateX(-300px) rotate(-15deg) scale(0.7); 
        opacity: 0; 
        box-shadow: 0 20px 30px rgba(0,0,0,0.8);
    }
    100% { 

        transform: translateX(0) rotate(0deg) scale(0.7); 
        opacity: 1; 
    }
}

.anim-draw {
    animation: card-draw-left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: none !important;
}



@keyframes card-death-ash {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
        filter: brightness(1) sepia(0) blur(0px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.8);
    }
    20% {
  
        transform: scale(1.05) translateY(-5px) rotate(-2deg);
        filter: brightness(1.5) sepia(1) hue-rotate(-50deg) saturate(5);
        box-shadow: 0 0 30px rgba(139, 0, 0, 1);
    }
    50% {
     
        transform: scale(0.9) translateY(10px) rotate(3deg);
        opacity: 0.8;
        filter: brightness(0.5) blur(2px) grayscale(0.5);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.9);
    }
    100% {

        transform: scale(0.5) translateY(40px) rotate(10deg);
        opacity: 0;
        filter: brightness(0) blur(10px) grayscale(1);
        box-shadow: 0 0 0 rgba(0,0,0,0);
    }
}

.anim-death {

    animation: card-death-ash 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) both;
    transition: none !important;
    pointer-events: none; 
    z-index: 100; 
}



@keyframes card-draw-left-full {
    0% { 
        transform: translateX(-300px) rotate(-15deg) scale(1); 
        opacity: 0; 
        box-shadow: 0 20px 30px rgba(0,0,0,0.8);
    }
    100% { 
        transform: translateX(0) rotate(0deg) scale(1); 
        opacity: 1; 
    }
}

.anim-draw-full {
    animation: card-draw-left-full 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: none !important;
}