:root {
    --primary-color: #6c5ce7;
    --primary-color-dark: #5649b8;
    --text-color: #ffffff;
    --bg-color-from: #6c5ce7;
    --bg-color-to: #4834d4;
    --card-bg: rgba(255, 255, 255, 0.15);
    --border-color: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    /* Dynamic moving gradient background */
    background: linear-gradient(135deg, var(--bg-color-from), var(--bg-color-to));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 1s ease-in-out;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.app-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow);
    text-align: center;
}

.header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 30px;
    line-height: 1.6;
}

.header p strong {
    font-size: 1.1rem;
    color: #ffd32a;
    /* Gold/yellow accent from the SP coin */
    display: inline-block;
    margin-bottom: 4px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 50px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.upload-area h2 {
    font-size: 1.25rem;
    margin-bottom: 5px;
}

.upload-area p {
    font-size: 0.9rem;
    opacity: 0.7;
}

.hidden {
    display: none !important;
}

.canvas-container {
    margin-bottom: 25px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Set a max width for preview so it fits nicely on screen */
    max-width: 100%;
}

canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.controls-section {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.control-group label {
    font-size: 0.85rem;
    margin-bottom: 8px;
    opacity: 0.9;
    font-weight: 600;
}

.control-group input[type=range] {
    width: 100%;
    accent-color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: #f1f2f6;
    color: var(--primary-color-dark);
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.footer {
    margin-top: 30px;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .app-container {
        padding: 25px;
        border-radius: 16px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}