* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #fff5f7 0%, #ffe0e6 50%, #ffd6df 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Header */
.app-header {
    text-align: center;
    padding: 10px 0;
}

.app-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    color: #e91e63;
    text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(233, 30, 99, 0.2);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.app-tagline {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: #666;
    font-weight: 400;
}

/* Control Panel */
.control-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(233, 30, 99, 0.15);
    width: 100%;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff6b9d 0%, #e91e63 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}

.slider-label {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

.jiggle-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #fce4ec, #e91e63);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.jiggle-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #e91e63;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(233, 30, 99, 0.5);
    transition: transform 0.2s;
}

.jiggle-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.jiggle-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #e91e63;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(233, 30, 99, 0.5);
}

/* Canvas Area */
.canvas-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.canvas-container {
    width: 100%;
    max-width: 600px;
    height: 400px;
    background: #fafafa;
    border-radius: 15px;
    border: 3px dashed #e91e63;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container.has-image {
    border-style: solid;
    border-color: #e91e63;
}

.uploaded-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.placeholder {
    text-align: center;
    padding: 40px 20px;
}

.placeholder-main {
    font-size: 1.3rem;
    color: #e91e63;
    font-weight: 600;
    margin-bottom: 10px;
}

.placeholder-hint {
    font-size: 1rem;
    color: #999;
    font-style: italic;
}

/* Ear styling */
.ear-container {
    user-select: none;
}

.ear-container.dragging {
    cursor: grabbing !important;
}

.ear-container:hover .resize-handle {
    opacity: 1;
}

.resize-handle {
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.resize-handle:hover {
    transform: scale(1.1);
}

/* Instructions */
.instructions {
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.instructions p {
    font-size: 0.85rem;
    color: #888;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: #999;
}

.app-footer a {
    color: #e91e63;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: #d81b60;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .control-panel {
        flex-direction: column;
        padding: 15px;
        gap: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .slider-container {
        width: 100%;
    }

    .canvas-container {
        height: 300px;
    }

    .placeholder-main {
        font-size: 1.1rem;
    }

    .placeholder-hint {
        font-size: 0.9rem;
    }

    .instructions p {
        font-size: 0.75rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .app-title {
        font-size: 1.5rem;
    }

    .canvas-container {
        height: 250px;
    }
}

/* Animation for the page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-header {
    animation: fadeInUp 0.5s ease-out;
}

.control-panel {
    animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.canvas-wrapper {
    animation: fadeInUp 0.5s ease-out 0.2s backwards;
}

.app-footer {
    animation: fadeInUp 0.5s ease-out 0.3s backwards;
}