/* ============================================================
   CARD-GOTHIC.CSS — Unified Gothic Card Design
   Replaces: enhanced-card-layout.css, card-design.css
   Theme: Dark charcoal + gold trim + Cinzel gothic font
   ============================================================ */

/* =================================================================
   1. CSS VARIABLES (Card-specific)
   ================================================================= */
:root {
    --card-bg:         linear-gradient(145deg, #1a1a2e, #0d0d1a);
    --card-bg-header:  linear-gradient(135deg, #0d0d1a, #151528);
    --card-bg-footer:  linear-gradient(135deg, #0d0d1a, #151528);
    --card-border:     rgba(201, 168, 76, 0.35);
    --card-border-hover: rgba(201, 168, 76, 0.6);
    --card-gold:       #c9a84c;
    --card-gold-dim:   rgba(201, 168, 76, 0.25);
    --card-parchment:  #e8dcc8;
    --card-parchment-dim: rgba(232, 220, 200, 0.6);
    --card-ink:        #0a0a14;
    --card-font-title: 'Cinzel', 'Palatino Linotype', 'Georgia', serif;
    --card-font-body:  'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Stat colors */
    --stat-atk:    linear-gradient(135deg, #c62828, #e53935);
    --stat-def:    linear-gradient(135deg, #1565c0, #1e88e5);
    --stat-hp:     linear-gradient(135deg, #2e7d32, #43a047);
    --stat-atk-shadow: rgba(198, 40, 40, 0.5);
    --stat-def-shadow: rgba(21, 101, 192, 0.5);
    --stat-hp-shadow:  rgba(46, 125, 50, 0.5);
}


/* =================================================================
   2. CARD BASE
   ================================================================= */
.card {
    position: relative;
    width: 180px;
    height: 252px;
    min-width: 100px;
    min-height: 140px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--card-font-body);
    color: var(--card-parchment);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(201, 168, 76, 0.1);
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--card-border-hover);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.6),
        0 0 12px var(--card-gold-dim),
        inset 0 1px 0 rgba(201, 168, 76, 0.15);
}

/* Inner gold frame line */
.card::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(201, 168, 76, 0.08);
    border-radius: 8px;
    pointer-events: none;
    z-index: 20;
}


/* =================================================================
   3. CARD HEADER (Cost / Name / Type ribbon)
   ================================================================= */
.card-header {
    display: flex;
    align-items: center;
    padding: 5px 7px;
    background: var(--card-bg-header);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    min-height: 30px;
    gap: 5px;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

/* Aether Cost Gem */
.card-cost,
.cost {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #7c4dff, #4a148c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 0 8px rgba(124, 77, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    line-height: 1;
    padding: 0;
    text-align: center;
}

/* Card Name */
.card-name {
    flex: 1;
    font-family: var(--card-font-title);
    font-size: 11px;
    font-weight: 700;
    color: var(--card-parchment);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
}

/* Card Type Badge */
.card-type {
    font-size: 7px;
    font-weight: 600;
    color: var(--card-parchment-dim);
    background: rgba(201, 168, 76, 0.1);
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    flex-shrink: 0;
    line-height: 1;
}

/* Hidden element */
.card-element {
    display: none !important;
}


/* =================================================================
   4. CARD ART WINDOW
   ================================================================= */
.card-image-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    margin: 3px 4px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 4px;
    background: var(--card-ink);
    min-height: 60px;
}

/* Inner gold highlight on art frame */
.card-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(201, 168, 76, 0.06);
    border-radius: 3px;
    pointer-events: none;
    z-index: 2;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.card-image-area {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.card-image-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.card:hover .card-image-area img {
    transform: scale(1.03);
}

/* Placeholder when no image */
.card-image-area:empty::before {
    content: 'No Image';
    color: rgba(201, 168, 76, 0.3);
    font-size: 11px;
    font-family: var(--card-font-title);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Alternate placeholder class */
.card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d0d1a, #1a1a2e);
    color: rgba(201, 168, 76, 0.3);
    font-size: 12px;
    font-family: var(--card-font-title);
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* =================================================================
   5. CARD DESCRIPTION / ABILITY TEXT
   ================================================================= */
.card-description-container {
    padding: 4px 7px;
    background: rgba(10, 10, 20, 0.5);
    min-height: 24px;
    max-height: 55px;
    overflow: hidden;
    border-top: 1px solid rgba(201, 168, 76, 0.08);
    flex-shrink: 0;
}

.card-description,
.card-abilities {
    font-size: 9px;
    line-height: 1.3;
    color: var(--card-parchment-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin: 0;
}

.card-ability-text,
.card-ability {
    font-size: 8px;
    font-style: italic;
    color: rgba(201, 168, 76, 0.5);
    margin-top: 2px;
    line-height: 1.2;
}


/* =================================================================
   6. CARD FOOTER — STAT CIRCLES
   ================================================================= */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: var(--card-bg-footer);
    border-top: 1px solid rgba(201, 168, 76, 0.12);
    min-height: 32px;
    flex-shrink: 0;
}

.card-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Attack circle */
.card-attack,
.attack {
    width: 24px;
    height: 24px;
    background: var(--stat-atk);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px var(--stat-atk-shadow);
    line-height: 1;
    flex-shrink: 0;
}

/* Defense circle */
.card-defense,
.defense {
    width: 24px;
    height: 24px;
    background: var(--stat-def);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px var(--stat-def-shadow);
    line-height: 1;
    flex-shrink: 0;
}

/* Health circle */
.card-health,
.health {
    width: 24px;
    height: 24px;
    background: var(--stat-hp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px var(--stat-hp-shadow);
    line-height: 1;
    flex-shrink: 0;
}


/* =================================================================
   7. RARITY SYSTEM
   ================================================================= */
.card[data-rarity="common"] {
    border-color: rgba(156, 163, 175, 0.3);
}

.card[data-rarity="uncommon"] {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(16, 185, 129, 0.15);
}

.card[data-rarity="rare"] {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(59, 130, 246, 0.2);
}

.card[data-rarity="epic"] {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(139, 92, 246, 0.25);
}

.card[data-rarity="legendary"] {
    border-color: rgba(201, 168, 76, 0.6);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.5),
        0 0 18px rgba(201, 168, 76, 0.3),
        0 0 36px rgba(201, 168, 76, 0.1);
    animation: legendary-shimmer 3s ease-in-out infinite;
}

.card[data-rarity="mythic"] {
    border-color: rgba(224, 64, 251, 0.5);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.5),
        0 0 18px rgba(224, 64, 251, 0.3);
    animation: mythic-cycle 4s ease-in-out infinite;
}

@keyframes legendary-shimmer {
    0%, 100% {
        border-color: rgba(201, 168, 76, 0.5);
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 15px rgba(201,168,76,0.25);
    }
    50% {
        border-color: rgba(201, 168, 76, 0.8);
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 25px rgba(201,168,76,0.4);
    }
}

@keyframes mythic-cycle {
    0%, 100% {
        border-color: rgba(224, 64, 251, 0.5);
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 18px rgba(224,64,251,0.3);
    }
    33% {
        border-color: rgba(255, 109, 0, 0.5);
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 18px rgba(255,109,0,0.3);
    }
    66% {
        border-color: rgba(0, 229, 255, 0.5);
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 18px rgba(0,229,255,0.3);
    }
}


/* =================================================================
   8. CARD BACK (for decks & opponent hand)
   ================================================================= */
.card-back-design,
.card .card-back {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(201, 168, 76, 0.04) 0px,
            rgba(201, 168, 76, 0.04) 1px,
            transparent 1px,
            transparent 6px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(201, 168, 76, 0.04) 0px,
            rgba(201, 168, 76, 0.04) 1px,
            transparent 1px,
            transparent 6px
        ),
        radial-gradient(circle at 50% 50%, rgba(201, 168, 76, 0.08), transparent 70%),
        linear-gradient(145deg, #1a1a2e, #0d0d1a);
    border-radius: 8px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    z-index: 30;
}

.card-back-design::after,
.card .card-back::after {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    color: rgba(201, 168, 76, 0.2);
}


/* =================================================================
   9. CARD HOVER STATES (for collection/deck contexts)
   ================================================================= */
.card.selected {
    border-color: var(--card-gold) !important;
    box-shadow:
        0 0 20px rgba(201, 168, 76, 0.4),
        inset 0 0 10px rgba(201, 168, 76, 0.05) !important;
}

.card.disabled {
    opacity: 0.4;
    filter: saturate(0.2) brightness(0.6);
    pointer-events: none;
}

.card.highlight {
    border-color: rgba(0, 229, 255, 0.6) !important;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3) !important;
}


/* =================================================================
   10. RESPONSIVE CARD SIZES
   ================================================================= */

/* Smaller cards in grid contexts */
.card-grid .card,
.collection-grid .card {
    width: 160px;
    height: 224px;
}

/* Tiny cards for deck lists */
.deck-card-list .card,
.mini-card {
    width: 120px;
    height: 168px;
}

.deck-card-list .card .card-description-container,
.mini-card .card-description-container {
    display: none;
}

.deck-card-list .card .card-name,
.mini-card .card-name {
    font-size: 9px;
}


/* =================================================================
   11. LEGACY COMPATIBILITY
   ================================================================= */

/* card-design.css used .card-container in some places */
.card-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* card-design.css aether cost (different selector, same purpose) */
.card-aether-cost {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #7c4dff, #4a148c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.4);
}

/* card-design.css type label */
.card-type-label {
    font-size: 8px;
    font-weight: 600;
    color: var(--card-parchment-dim);
    background: rgba(201, 168, 76, 0.1);
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* card-design.css stat bar (different structure) */
.card-stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 4px 8px;
    background: var(--card-bg-footer);
    border-top: 1px solid rgba(201, 168, 76, 0.12);
}

.card-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: white;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.icon-attack, .card-stat.attack-stat {
    background: var(--stat-atk);
    box-shadow: 0 2px 6px var(--stat-atk-shadow);
}

.icon-defense, .card-stat.defense-stat {
    background: var(--stat-def);
    box-shadow: 0 2px 6px var(--stat-def-shadow);
}

.icon-health, .card-stat.health-stat {
    background: var(--stat-hp);
    box-shadow: 0 2px 6px var(--stat-hp-shadow);
}

/* card-design.css name section */
.card-name-section {
    font-family: var(--card-font-title);
    font-size: 12px;
    font-weight: 700;
    color: var(--card-parchment);
    text-align: center;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
}

/* Card image (direct img, not in area) */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
