* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.coupon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.coupon-card {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 3px solid #fff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.coupon-header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.coupon-header h2 {
    font-size: 1.8em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.serial {
    font-size: 0.9em;
    opacity: 0.8;
    font-family: 'Courier New', monospace;
}

.scratch-area {
    position: relative;
    width: 350px;
    height: 200px;
    margin: 20px auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

.prize-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.prize-text {
    text-align: center;
    color: #333;
}

.prize-title {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #e74c3c;
}

.prize-amount {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #27ae60;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.prize-subtitle {
    display: block;
    font-size: 1em;
    margin-bottom: 15px;
    color: #666;
}

.prize-code {
    background: #333;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    display: inline-block;
}

#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: crosshair;
    border-radius: 10px;
}

.scratch-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.instruction-content {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.instruction-icon {
    font-size: 2em;
    margin-bottom: 8px;
    animation: bounce 2s infinite;
}

.instruction-text {
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.coupon-footer {
    text-align: center;
    color: white;
    margin-top: 20px;
}

.expiry-date {
    font-weight: bold;
    color: #fff3cd;
    font-size: 0.9em;
    margin-top: 10px;
}

.claim-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.claim-btn:enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

.claim-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.new-coupon-btn, .reset-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.new-coupon-btn:hover, .reset-btn:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    transition: color 0.3s;
}

.close:hover {
    color: white;
}

.modal-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.message-modal .modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #fff;
    max-width: 450px;
}

#messageContent {
    text-align: center;
    color: white;
    padding: 20px 10px;
}

.message-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.message-text {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.4;
}

.message-details {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    border-left: 4px solid #fff;
}

.message-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    transition: color 0.3s;
}

.message-close:hover {
    color: white;
}

.message-modal.success .modal-content {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.message-modal.warning .modal-content {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.message-modal.info .modal-content {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 480px) {
    .coupon-card {
        margin: 0 10px;
        padding: 15px;
    }
    
    .scratch-area {
        width: 300px;
        height: 180px;
    }
    
    #scratchCanvas {
        width: 300px !important;
        height: 180px !important;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .new-coupon-btn, .reset-btn {
        width: 200px;
    }
    
    .prize-amount {
        font-size: 2em;
    }
    
    .instruction-content {
        padding: 12px 20px;
    }
    
    .instruction-text {
        font-size: 1em;
    }
    
    .instruction-icon {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 20px;
    }
    
    .message-text {
        font-size: 1.1em;
    }
}
    overflow: hidden;
}

.coupon-header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.coupon-header h2 {
    font-size: 1.8em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.serial {
    font-size: 0.9em;
    opacity: 0.8;
    font-family: 'Courier New', monospace;
}

.scratch-area {
    position: relative;
    width: 350px;
    height: 200px;
    margin: 20px auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

.prize-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.prize-text {
    text-align: center;
    color: #333;
}

.prize-title {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #e74c3c;
}

.prize-amount {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #27ae60;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.prize-subtitle {
    display: block;
    font-size: 1em;
    margin-bottom: 15px;
    color: #666;
}

.prize-code {
    background: #333;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    display: inline-block;
}

#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: crosshair;
    border-radius: 10px;
}

.scratch-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.instruction-content {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.instruction-icon {
    font-size: 2em;
    margin-bottom: 8px;
    animation: bounce 2s infinite;
}

.instruction-text {
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.scratch-instruction.hidden {
    opacity: 0;
}

.coupon-footer {
    text-align: center;
    color: white;
    margin-top: 20px;
}

.expiry-date {
    font-weight: bold;
    color: #fff3cd;
    font-size: 0.9em;
    margin-top: 10px;
}

.claim-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.claim-btn:enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

.claim-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.new-coupon-btn,
.reset-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.new-coupon-btn:hover,
.reset-btn:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

/* Modal de Mensajes */
.message-modal .modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #fff;
    max-width: 450px;
}

.message-modal-content {
    position: relative;
}

#messageContent {
    text-align: center;
    color: white;
    padding: 20px 10px;
}

.message-icon {
    font-size: 3em;
    margin-bottom: 15px;
    animation: messageIconPulse 2s infinite;
}

.message-text {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.4;
}

.message-details {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    border-left: 4px solid #fff;
}

.message-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    transition: color 0.3s;
}

.message-close:hover {
    color: white;
}

@keyframes messageIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Diferentes tipos de mensajes */
.message-modal.success .message-icon::before {
    content: '✅';
}

.message-modal.warning .message-icon::before {
    content: '⚠️';
}

.message-modal.info .message-icon::before {
    content: 'ℹ️';
}

.message-modal.success .modal-content {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.message-modal.warning .modal-content {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.message-modal.info .modal-content {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    transition: color 0.3s;
}

.close:hover {
    color: white;
}

.modal-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Animaciones */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.prize-revealed {
    animation: pulse 0.6s ease-in-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .coupon-card {
        margin: 0 10px;
        padding: 15px;
    }
    
    .scratch-area {
        width: 300px;
        height: 180px;
    }
    
    #scratchCanvas {
        width: 300px !important;
        height: 180px !important;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .new-coupon-btn,
    .reset-btn {
        width: 200px;
    }
    
    .prize-amount {
        font-size: 2em;
    }
    
    .instruction-content {
        padding: 12px 20px;
    }
    
    .instruction-text {
        font-size: 1em;
    }
    
    .instruction-icon {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 20px;
    }
    
    .message-text {
        font-size: 1.1em;
    }
}

/* Efectos especiales */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    animation: sparkleAnim 1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sparkleAnim {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Efectos adicionales para mejor UX */
.coupon-card:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.claim-btn:enabled {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.claim-btn:enabled:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

/* Estados del canvas */
#scratchCanvas.scratching {
    cursor: grabbing;
}

/* Indicador de progreso visual */
.scratch-progress {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.8em;
    z-index: 4;
}
