/* Card Styles */
.card {
    width: 140px;
    height: 200px;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-20px) scale(1.08);
    z-index: 100;
}

.card.attack-card {
    background: linear-gradient(160deg, #2a1515, #1a0a0a);
    border: 2px solid var(--attack-color);
    box-shadow: 0 2px 15px rgba(224, 96, 80, 0.2);
}

.card.skill-card {
    background: linear-gradient(160deg, #152025, #0a1518);
    border: 2px solid var(--skill-color);
    box-shadow: 0 2px 15px rgba(80, 176, 224, 0.2);
}

.card.power-card {
    background: linear-gradient(160deg, #201525, #150a18);
    border: 2px solid var(--power-color);
    box-shadow: 0 2px 15px rgba(192, 96, 224, 0.2);
}

.card.curse-card {
    background: linear-gradient(160deg, #200a10, #100508);
    border: 2px solid var(--curse-color);
    box-shadow: 0 2px 15px rgba(128, 0, 32, 0.2);
}

.card.upgraded {
    border-width: 2px;
    box-shadow: 0 0 12px rgba(64, 192, 112, 0.2);
}

.card.upgraded .card-name {
    color: var(--accent-green) !important;
}

.card.upgraded .card-art {
    background: rgba(64, 192, 112, 0.08);
}

.card.upgraded::after {
    content: '★';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 12px;
    color: var(--accent-green);
    z-index: 2;
}

.card:hover.attack-card { box-shadow: 0 4px 25px rgba(224, 96, 80, 0.4); }
.card:hover.skill-card { box-shadow: 0 4px 25px rgba(80, 176, 224, 0.4); }
.card:hover.power-card { box-shadow: 0 4px 25px rgba(192, 96, 224, 0.4); }

.card.unplayable {
    opacity: 0.4;
    filter: brightness(0.5) grayscale(0.3);
}

.card.unplayable:hover {
    transform: translateY(-5px);
    cursor: not-allowed;
}

/* Playable cards get a subtle glow to distinguish from unplayable */
.hand-area .card:not(.unplayable) {
    filter: brightness(1.05);
}

/* Card cost gem */
.card-cost {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, var(--accent-gold), #a07020);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 16px;
    color: #1a1000;
    border: 2px solid rgba(255,220,120,0.6);
    box-shadow: 0 0 10px rgba(240, 192, 96, 0.4);
    z-index: 2;
}

/* Card art area */
.card-art {
    height: 80px;
    margin: 8px 8px 0 8px;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

/* Card rarity stripe */
.card-rarity {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.card-rarity.common { background: var(--common-color); }
.card-rarity.uncommon { background: linear-gradient(90deg, var(--uncommon-color), #80c0ff, var(--uncommon-color)); }
.card-rarity.rare { background: linear-gradient(90deg, var(--rare-color), #ffe080, var(--rare-color)); animation: rarity-shine 2s linear infinite; }
.card-rarity.starter { background: var(--text-dim); }

@keyframes rarity-shine {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Card name */
.card-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 11px;
    text-align: center;
    padding: 6px 8px 2px;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card type */
.card-type {
    font-size: 9px;
    text-align: center;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Card description */
.card-desc {
    font-size: 10px;
    text-align: center;
    padding: 4px 8px;
    color: var(--text-secondary);
    line-height: 1.35;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    hyphens: auto;
}

.card-desc .highlight {
    color: var(--accent-gold);
    font-weight: 700;
}

/* Card targeting (glow when selecting target) */
.card.targeting {
    box-shadow: 0 0 30px rgba(240, 192, 96, 0.6) !important;
    animation: pulse-glow 0.8s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from { box-shadow: 0 0 20px rgba(240, 192, 96, 0.4); }
    to { box-shadow: 0 0 40px rgba(240, 192, 96, 0.7); }
}

/* Card being played animation */
.card.playing {
    animation: card-play 0.4s ease forwards;
}

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

/* Card draw animation */
.card.drawing {
    animation: card-draw 0.3s ease forwards;
}

@keyframes card-draw {
    0% { transform: translateX(-200px) rotate(-20deg); opacity: 0; }
    100% { transform: translateX(0) rotate(0); opacity: 1; }
}

/* Mini card for deck view */
.card.mini {
    width: 110px;
    height: 160px;
}

.card.mini .card-cost {
    width: 24px;
    height: 24px;
    font-size: 13px;
    top: 4px;
    left: 4px;
}

.card.mini .card-art {
    height: 60px;
    font-size: 28px;
    margin: 6px 6px 0 6px;
}

.card.mini .card-name {
    font-size: 10px;
    padding: 4px 6px 1px;
}

.card.mini .card-desc {
    font-size: 9px;
    padding: 2px 6px;
}

/* Card selection highlight */
.card.selected {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 30px rgba(240, 192, 96, 0.5) !important;
    transform: translateY(-10px) scale(1.05);
}

/* Card exhaust visual */
.card.exhausting {
    animation: card-exhaust 0.5s ease forwards;
}

@keyframes card-exhaust {
    0% { transform: scale(1); opacity: 1; filter: brightness(1); }
    50% { transform: scale(0.8); opacity: 0.6; filter: brightness(2); }
    100% { transform: scale(0); opacity: 0; filter: brightness(3); }
}
