/* BuddyScript Card Styles */
.card-bs-app {
    position: relative;
    /* width: 320px; */
    padding: 8px; /* Reduced padding */
    border: 2px solid #FFD700; /* Gold border */
    border-radius: 8px;
    background: linear-gradient(135deg, #2b1a3f 0%, #4b2e6b 100%); /* Mystical purple gradient */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), inset 0 0 5px rgba(255, 215, 0, 0.3);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #fff;
    font-family: Arial, sans-serif;
    display: flex; /* Use flexbox to control layout */
    flex-direction: column; /* Stack header, image, and form vertically */
    justify-content: space-between; /* Push form to bottom */
}

.card-bs-app:hover {
    transform: scale(1.02); /* Subtle zoom on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), inset 0 0 8px rgba(255, 215, 0, 0.5);
}

.card-bs-app h1 {
    font-size: 18px; /* Slightly smaller to save space */
    color: #FFD700; /* Gold title */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    margin: 0 0 6px; /* Reduced margin */
    text-align: center;
}

.card-bs-app-image {
    width: 32px; /* Smaller size to fit layout */
    height: 32px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #FFD700; /* Gold border */
    background: #3a2c5f; /* Darker purple background */
    cursor: pointer; /* Indicate clickability */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-bs-app-image:hover {
    transform: scale(1.1); /* Subtle zoom on hover */
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.card-bs-app-form {
    display: flex;
    flex-direction: row; /* Horizontal layout for command and button */
    align-items: center;
    gap: 8px; /* Reduced gap */
    flex-wrap: wrap; /* Allow wrapping if content overflows */
    margin-top: auto; /* Push form to bottom in flex context */
    padding: 4px 8px; /* Minimal padding to save space */
}

.card-bs-app-text-command {
    font-size: 14px; /* Slightly smaller to save space */
    color: #E0E0E0; /* Light gray for readability */
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    padding: 6px; /* Reduced padding */
    border-radius: 4px;
    border: 1px solid #4682B4; /* Blue accent */
    flex: 1; /* Grow to fill available space */
    min-width: 100px; /* Ensure readability */
    text-align: center;
    word-break: break-all; /* Handle long commands */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}

.card-bs-app-submit {
    padding: 6px 12px; /* Reduced padding */
    background: #FFD700; /* Gold button */
    color: #2b1a3f; /* Dark purple text */
    border: none;
    border-radius: 4px;
    font-size: 13px; /* Slightly smaller to save space */
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.card-bs-app-submit:hover {
    background: #FFEFBF; /* Lighter gold on hover */
    transform: scale(1.05); /* Subtle zoom */
}

/* Decorative overlay for mystical effect */
.card-bs-app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Ensure content is above overlay */
.card-bs-app h1,
.card-bs-app-image,
.card-bs-app-form {
    position: relative;
    z-index: 1;
}

/* Responsive adjustments for mobile */
@media (max-width: 767px) and (pointer: coarse) and (hover: none) {
 
    .card-bs-app {
        width: 95%; /* Maximize mobile viewport */
        max-width: none; /* Remove 400px cap */
        padding: 0.5rem; /* ~8px, reduced from 16px */
        margin: 0.5rem auto; /* ~8px top/bottom, centered */
    }

    .card-bs-app h1 {
        font-size: 1.25rem; /* ~20px, reduced from 36px */
        margin-bottom: 0.5rem; /* ~8px, reduced from 12px */
    }

    .card-bs-app-image {
        width: 2.75rem; /* ~28px, reduced from 64px */
        height: 2.75rem;
        padding: 0.25rem; /* ~4px, for ~36px tap target */
    }

    .card-bs-app-form {
        gap: 0.625rem; /* ~10px, reduced from 16px */
        flex-direction: column; /* Stack for mobile */
        padding: 0.5rem; /* ~8px, reduced from 8px 16px */
        justify-items: center; /* Center items */
    }

    .card-bs-app-text-command {
        font-size: 0.875rem; /* ~14px, reduced from 28px */
        padding: 0.625rem; /* ~10px, reduced from 12px */
        min-width: 0; /* Allow flexible width */
    }

    .card-bs-app-submit {
        font-size: 0.875rem; /* ~14px, reduced from 26px */
        padding: 0.625rem 1rem; /* ~10px 16px, reduced from 12px 24px */
        min-width: 7.5rem; /* ~120px, for touch-friendliness */
    }

    .card-bs-app:hover,
    .card-bs-app-submit:hover,
    .card-bs-app-image:hover {
        transform: none; /* Disable hover effects */
        box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.5), inset 0 0 0.3125rem rgba(255, 215, 0, 0.3); /* Default shadow */
        background: #FFD700; /* Reset for submit button */
    }
}