#card-preview { 
    width: 100%;
    height: 70vh;
    padding-bottom: var(--spacing-unit);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    max-width: 1200px;
}

#card-preview>#canvas {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#card-preview>#canvas>canvas {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    height: 58vh;
    max-height: 90%;
    object-fit: contain;
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

#canvas-bg {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 72vh;
    max-height: 100%;
    z-index: -1;
}

@media screen and (max-width:767px),
screen and (max-device-width:767px) {
    #card-preview {
        height: 50vh;
        min-height: 350px;
        max-height: 400px;
        padding: 10px;
        margin-bottom: 15px;
        overflow: visible;
        touch-action: manipulation;
    }

    #card-preview>#canvas {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
        width: 100%;
        position: relative;
    }
    
    #card-preview>#canvas>canvas {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        object-fit: contain;
        height: auto;
        max-height: 90%;
        width: auto;
        max-width: 90%;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        border: 1px solid var(--accent-color);
        border-radius: 4px;
        touch-action: manipulation;
    }

    #canvas-bg {
        display: none;
    }
}