/* === Element-specific styles and animations === */

/* Palette element drag feedback */
.palette-element[draggable="true"]:active {
    transform: scale(0.95);
}

/* Touch clone styling */
.touch-clone {
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

/* Canvas element entrance animation */
.canvas-element {
    animation: elementDrop 0.3s ease-out;
}

@keyframes elementDrop {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Override entrance animation for health states (they have their own) */
.canvas-element.thriving {
    animation: pulse 3s infinite ease-in-out;
}

.canvas-element.dying {
    animation: wither 2s infinite ease-in-out;
}

/* Connection lines (visual hints for dependencies) */
.canvas-element::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: background 0.5s;
}

.canvas-element.thriving::after {
    background: var(--health-high);
    box-shadow: 0 0 6px var(--health-high);
}

.canvas-element.struggling::after {
    background: var(--health-mid);
    box-shadow: 0 0 6px var(--health-mid);
}

.canvas-element.dying::after {
    background: var(--health-low);
    box-shadow: 0 0 6px var(--health-low);
}

/* Tier unlock animation on palette */
.palette-tier.just-unlocked .tier-header {
    animation: tierGlow 1s ease-out;
}

@keyframes tierGlow {
    0% { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }
    100% { color: var(--text-muted); text-shadow: none; }
}

/* Ecosystem card icons */
.ecosystem-card::before {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
}

/* Remove button hover effect */
.el-remove:hover {
    transform: scale(1.2);
    background: #ff2222;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .game-body {
        flex-direction: column;
    }

    .palette {
        width: 100%;
        max-height: 180px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        overflow-y: hidden;
    }

    .palette-tiers {
        display: flex;
        gap: 16px;
        padding-bottom: 8px;
    }

    .palette-tier {
        min-width: 160px;
        margin-bottom: 0;
    }

    .game-header {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }

    .header-center {
        order: 3;
        max-width: 100%;
        margin: 0;
        width: 100%;
    }

    .ecosystem-cards {
        flex-direction: column;
        align-items: center;
    }

    .ecosystem-card {
        width: 100%;
        max-width: 320px;
    }
}
