body {
    font-family: 'Quicksand', sans-serif; /* Primary UI font */
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); /* Rainbow gradient background (example) */
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top initially */
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

#app {
    background-color: rgba(255, 255, 255, 0.95); /* Slightly more opaque white background */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15); /* Slightly stronger shadow */
    text-align: center;
    max-width: 800px; /* Increased max width */
    width: 100%;
    box-sizing: border-box;
}

header h1 {
    font-family: 'ZCOOL QingKe HuangYou', cursive; /* Using ZCOOL QingKe HuangYou for the main title */
    color: #e91e63; /* Pink color */
    margin-bottom: 5px;
    font-size: 2.8em; /* Slightly larger */
}

header p small {
    font-family: 'Quicksand', sans-serif; /* Using Quicksand for the tagline */
    color: #673ab7; /* Purple color */
    font-size: 1.1em; /* Slightly larger */
}

h2 {
    font-family: 'Fredoka', sans-serif; /* Using Fredoka for section titles */
    color: #009688; /* Teal color */
    margin-top: 25px;
    margin-bottom: 20px;
    font-size: 2em; /* Slightly larger */
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-family: 'Quicksand', sans-serif; /* Quicksand for labels */
    font-size: 1.1em;
    color: #333;
}

.input-group input[type="text"],
.input-group textarea {
    width: calc(100% - 24px); /* Adjust for padding and border */
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Quicksand', sans-serif; /* Quicksand for input text */
    font-size: 1em;
    box-sizing: border-box;
}

#theme-selector,
#compliment-selector {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 15px; /* Increased space between items */
    align-items: center;
    justify-content: center; /* Center theme options */
}

.theme-option {
    padding: 10px 15px;
    border: 2px solid #ff9800; /* Orange border */
    border-radius: 25px; /* More rounded */
    cursor: pointer;
    background-color: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1em; /* Slightly larger font */
    width: 90px; /* Increased width */
    height: 90px; /* Increased height */
    justify-content: center;
    text-align: center;
    user-select: none; /* Prevent text selection */
}

.theme-option:hover {
    background-color: #fff3e0; /* Light orange on hover */
    transform: translateY(-5px) rotate(2deg); /* More playful hover effect */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* Add shadow on hover */
}

.theme-option.selected {
    border-color: #4caf50; /* Highlight color when selected */
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.7); /* Stronger glow */
    background-color: #e8f5e9; /* Light green background when selected */
}

button {
    padding: 12px 25px; /* Increased padding */
    background-color: #4caf50; /* Green color */
    color: white;
    border: none;
    border-radius: 25px; /* More rounded buttons */
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.1s ease;
    font-family: 'Fredoka', sans-serif; /* Fredoka for buttons */
}

button:hover {
    background-color: #388e3c; /* Darker green on hover */
    transform: translateY(-2px); /* Slight lift on hover */
}

button:active {
    transform: translateY(0); /* Press effect */
}

#generate-card-btn {
    background-color: #2196f3; /* Blue color */
    margin-top: 30px;
    font-size: 1.4em; /* Larger generate button */
    padding: 15px 30px;
}

#generate-card-btn:hover {
    background-color: #1976d2; /* Darker blue */
}

#card-preview-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: none;
    position: relative;
    min-height: 450px; /* Ensure section has some height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#magic-card {
    position: relative;
    width: 100%;
    max-width: 450px; /* Increased max width */
    margin: 20px auto;
    background-color: #fff;
    border-radius: 20px; /* More rounded card corners */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2); /* Stronger shadow */
    overflow: hidden;
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px; /* Increased padding */
    box-sizing: border-box;
    border: 5px solid #ffcc00;
    /* Animations will be added here */
}

#card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    /* Themed backgrounds/patterns will be set by JS */
    /* Initial background color from JS is temporary */
}

#card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    justify-content: center; /* Center content vertically in the card */
    padding: 10px; /* Add some padding to content */
}

#card-to-name {
    font-size: 1.8em; /* Larger name */
    font-weight: bold;
    margin-bottom: 5px;
    color: #3f51b5; /* Indigo color */
    font-family: 'Fredoka', sans-serif; /* Fredoka for name */
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff; /* Text outline */
}

#card-date-display {
    font-size: 1em; /* Slightly larger date */
    color: #555;
    margin-bottom: 20px;
    font-family: 'Quicksand', sans-serif; /* Quicksand for date */
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff; /* Text outline */
}

#card-compliment {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 1.2em; /* Larger compliment text */
    line-height: 1.7;
    margin-bottom: 20px; /* Space before footer */
}

#card-compliment .chinese-text {
    font-family: 'ZCOOL QingKe HuangYou', cursive; /* Using ZCOOL QingKe HuangYou for Chinese text */
    font-size: 1.3em; /* Larger Chinese text */
    color: #00796b; /* Dark teal for Chinese */
    margin-bottom: 5px;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff; /* Text outline */
}

#card-compliment .english-text {
    font-family: 'Quicksand', sans-serif; /* Quicksand for English font */
    font-size: 1.1em;
    color: #555; /* Slightly darker gray for English */
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff; /* Text outline */
}

#card-footer {
    font-size: 0.9em; /* Slightly larger footer */
    color: #777;
    margin-top: 15px;
    font-family: 'Quicksand', sans-serif; /* Quicksand for footer */
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff; /* Text outline */
}

#card-watermark {
    font-size: 0.7em; /* Smaller font size for watermark */
    color: #555; /* Slightly darker gray */
    font-family: 'Quicksand', sans-serif; /* Quicksand for watermark */
    margin-top: 5px;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff; /* Text outline */
    opacity: 0.7; /* Make watermark slightly transparent */
}

#action-area {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px; /* Increased gap */
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

#action-area button {
    background-color: #ff5722; /* Deep Orange */
    font-size: 1.1em;
}

#action-area button:hover {
    background-color: #e64a19; /* Darker Deep Orange */
}

/* Mobile Optimization */
@media (max-width: 768px) { /* Adjusted breakpoint */
    body {
        padding: 15px;
    }

    #app {
        padding: 20px;
    }

    header h1 {
        font-size: 2.2em; /* Adjusted for smaller screens */
    }

    h2 {
        font-size: 1.7em; /* Adjusted for smaller screens */
    }

    .input-group label {
        font-size: 1em;
    }

    .input-group input[type="text"],
    .input-group textarea {
        padding: 10px;
        font-size: 0.9em;
    }

    #theme-selector,
    #compliment-selector,
    #action-area {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    #random-image-preview img {
        max-width: 80px; /* Smaller preview on mobile */
        max-height: 80px;
    }

    .theme-option, button {
        width: 100%;
        max-width: 300px; /* Limit width on smaller screens */
        text-align: center;
    }

    #magic-card {
        max-width: 100%;
        padding: 20px;
    }

    #card-to-name {
        font-size: 1.6em;
    }

    #card-compliment {
        font-size: 1em;
    }

    #card-compliment .chinese-text {
        font-size: 1.1em;
    }

    #card-compliment .english-text {
        font-size: 1em;
    }
}

/* Theme-specific background styles - Removed as per user request */