* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    background: #341a39;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(72,28,96,0.4);
    transition: transform 0.3s ease;
}

.header h3 {
    font-size: 20px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    display: inline-block;
    animation: gentle-shake 2s infinite;
}
@keyframes gentle-shake {
    0% { transform: rotate(0deg); }
    80% { transform: rotate(0deg); }
    85% { transform: rotate(1deg); }
    90% { transform: rotate(-1deg); }
    95% { transform: rotate(1deg); }
    100% { transform: rotate(0deg); }
}
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.content {
    padding: 30px 20px;
}

.upload-section {
    text-align: center;
}

.upload-area {
    border: 2px dashed #667eea;
    padding: 40px;
    border-radius: 15px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area span {
    font-size: 50px;
    display: block;
    margin-bottom: 10px;
}

.upload-area:hover {
    background: #eef1ff;
    border-color: #764ba2;
    transform: scale(1.02);
}

.upload-area.dragover {
	 background: #eef1ff;
	 border: 3px solid #764ba2;
	 transform: scale(1.05);
}
.upload-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.preview-container {
    margin-top: 20px;
    display: none;
}

.preview-image {
    width: 70%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: block;
    margin: 0 auto;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    margin-top: 10px;
}

.btn-full {
    margin-top: 20px;
    width: 100%;
}

.scratch-section {
    display: none;
    text-align: center;
}

.scratch-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 20px auto;
    line-height: 0;
    touch-action: none;
    background: #eee;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#scratchImage {
    width: 100%;
    height: auto;
    display: block;
    z-index: 1;
    filter: blur(10px) brightness(0.5);
    transition: filter 0.6s ease, transform 0.6s ease;
}

#scratchCanvas {
    position: absolute;
    cursor: url('https://img.icons8.com/emoji/32/000000/coin-emoji.png'), auto;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    z-index: 10;
}

.scratch-hint {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#shareLink {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f9f9f9;
    color: #333;
    font-family: monospace;
}

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
}

#progressFill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.copy-feedback {
    display: none;
    color: #065f46;
    background: #d1fae5;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .header h1 { font-size: 24px; }
    .content { padding: 20px 15px; }
}

@media (max-width: 600px) {
    .header h3 { font-size: 16px; }
    .content { padding: 20px 15px; }
}

#uploadBtn {
    width: 100%;
    margin-top: 15px;
}

#progressContainer {
    display: none;
    margin-top: 20px;
}

#scratchSection {
    display: none;
}

.btn-full {
    margin-top: 20px;
    width: 100%;
}

#copyBtn {
    background: #28a745;
    margin-bottom: 10px;
    width: 100%;
}

.whatsapp-full {
    width: 100%;
}

.back-home {
    margin-top: 15px;
    cursor: pointer;
    color: #667eea; /* Un blu pił coerente con il tuo brand */
    text-decoration: underline;
}