/* =========================================== */
/* VARIABLES CSS */
/* =========================================== */
:root {
    --primary-color: #ff7e5f;
    --secondary-color: #feb47b;
    --dark-blue: #1a2a6c;
    --blue-color: #0066cc;
    --red: #b21f1f;
    --yellow: #fdbb2d;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #333;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --info-color: #2196F3;
    --border-radius: 12px;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* =========================================== */
/* GENERALES: RESET Y ESTILOS BASE */
/* =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-image: url('../img/fondo.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 15px;
    color: var(--dark-gray);
    position: relative;
}

/* Clase para prevenir scroll del body cuando hay modales abiertos */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Imagen de fondo para móviles */
@media (max-width: 768px) {
    body {
        background-image: url('../img/fondo-moviles.jpeg');
    }
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 42, 108, 0), rgba(178, 31, 31, 0), rgba(253, 187, 45, 0));
    z-index: -1;
}

/* =========================================== */
/* CONTENEDOR PRINCIPAL */
/* =========================================== */
.main-wrapper {
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

/* GIF decorativo - SOLO en desktop */
.main-wrapper::after {
    content: '';
    position: absolute;
    top: 110px;
    bottom: -30px;
    right: -250px;
    width: 500px;
    height: 500px;
    background-image: url('../img/mascota.gif');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 50;
    margin-top: 36px;
    width: 90%;
    background-color: rgba(0, 102, 204, 0.95);
    border-radius: var(--border-radius);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    backdrop-filter: blur(10px);
    max-width: 680px;
    margin: 20px auto 0;
    border: 1px solid var(--blue-color);
}

.container.modal-open {
    filter: blur(4px);
    opacity: 0.8;
    pointer-events: none;
}

.container-with-logo {
    position: relative;
    width: 100%;
}

/* =========================================== */
/* LOGO - AJUSTADO PARA MÓVIL */
/* =========================================== */
.floating-logo {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 55;
    width: 100%;
    display: flex;
    justify-content: center;
    transition: var(--transition);
}

.floating-logo.modal-open {
    filter: blur(3px) opacity(0.7);
    transform: translate(-50%, 0) scale(0.98);
    z-index: 1;
}

.logo-image {
    max-width: 220px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    pointer-events: auto;
    border-radius: 8px;
}

.floating-logo.modal-open .logo-image {
    pointer-events: none;
}

/* =========================================== */
/* HEADER */
/* =========================================== */
.header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 18px 25px;
    text-align: center;
    border-bottom: 2px solid rgba(177, 39, 39, 0.2);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 6px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.header p {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 500;
}

/* =========================================== */
/* CONTENIDO */
/* =========================================== */
.content {
    padding: 20px;
    padding-top: 45px;
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 480px;
}

.game-section {
    display: flex;
    flex-direction: column;
    width: 100% !important;
}

.game-container {
    flex: 1;
    padding: 18px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--blue-color);
    min-height: 480px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* =========================================== */
/* TARJETA DE RASCAR */
/* =========================================== */
.game-header {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.status-indicator {
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
    text-align: center;
    min-width: 140px;
    border: 1px solid;
}

.status-indicator.active {
    background: linear-gradient(to right, rgba(255, 126, 95, 0.2), rgba(254, 180, 123, 0.2));
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.status-indicator.ganador {
    background: linear-gradient(to right, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    color: var(--success-color);
    border-color: var(--success-color);
}

.status-indicator.agotado {
    background: linear-gradient(to right, rgba(158, 158, 158, 0.2), rgba(158, 158, 158, 0.1));
    color: #666;
    border-color: #999;
}

.attempts-counter {
    display: none !important;
}

.game-instructions {
    color: #003384;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0;
    margin-top: 30px;
    padding-top: 60px;
    line-height: 1.2;
}

.scratch-card-container {
    width: 100%;
    max-width: 320px;
    height: 220px;
    margin: 0 auto 18px;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
}

.scratch-card-active {
    width: 100%;
    height: 100%;
}

.scratch-card {
    width: 100%;
    height: 100%;
    position: relative;
}

.scratch-card-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 100 !important;
    pointer-events: auto;
}

.scratch-card-canvas.disabled {
    pointer-events: none;
    opacity: 0.3 !important;
}

.card-content {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--dark-blue), var(--red));
    color: white;
    z-index: 1 !important;
    padding: 12px;
    text-align: center;
}

.card-content i {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.prize-amount {
    font-size: 2rem;
    font-weight: bold;
    margin: 6px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.prize-message {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 6px;
}

.scratch-instructions {
    text-align: center;
    margin-bottom: 12px;
    background-color: rgba(255, 126, 95, 0.1);
    padding: 8px 10px;
    border-radius: 8px;
    margin-top: 8px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
}

/* =========================================== */
/* CONTROLES Y BOTONES */
/* =========================================== */
.game-controls {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.btn {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    max-width: 250px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(255, 126, 95, 0.4);
}

.btn-secondary {
    background: linear-gradient(to right, #6c757d, #868e96);
}

.claim-prize-btn {
    background: linear-gradient(to right, #ffd700, #ffaa00) !important;
    color: #333 !important;
    font-weight: bold !important;
    border: 2px solid #ffaa00 !important;
}

/* =========================================== */
/* MODAL DE RESULTADOS - SIN SCROLL */
/* =========================================== */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 19000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    max-height: none;
}

.modal-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header h2 {
    font-size: 1.2rem;
}

.close-modal {
    background: rgba(255, 255, 255, 0);
    border: none;
    color: rgba(255, 255, 255, 0.047);
    font-size: 1.3rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0);
    transform: scale(1.1);
}

.close-modal[style*="pointer-events: none"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-body {
    padding: 12px;
    text-align: center;
    overflow: visible;
    flex: 1 1 auto;
}

.result-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.result-icon.success {
    color: var(--success-color);
}

.result-icon.warning {
    color: var(--warning-color);
}

.result-icon.info {
    color: var(--info-color);
}

#result-title {
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-weight: 700;
    word-wrap: break-word;
    color: #fffcfc;
}

.result-modal-message {
    font-size: 1rem;
    margin-bottom: 5px;
    opacity: 0.9;
    word-wrap: break-word;
    color: #666;
}

.prize-result {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 8px 0;
    color: var(--primary-color);
    word-break: break-word;
    line-height: 1.2;
}

.attempts-info {
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-style: italic;
    opacity: 0.8;
    word-wrap: break-word;
    color: #666;
}

.modal-footer {
    padding: 12px 15px;
    display: flex;
    gap: 8px;
    justify-content: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.modal-footer .btn {
    min-width: 120px;
    padding: 8px 15px;
    font-size: 0.9rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

#claim-prize-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #333 !important;
    font-weight: bold !important;
}

#next-attempt-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2) !important;
}

#play-again-btn {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2) !important;
}

/* =========================================== */
/* FORMULARIO - MODAL PASO 3 - FONDO DIFUMINADO */
/* =========================================== */
.form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.form-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prize-confirmation {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, var(--success-color), #45a049);
    color: white;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.prize-confirmation h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

#prize-confirmed {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 5px 0;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.form-container {
    padding: 20px 20px;
    background: white;
    overflow-y: auto !important;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(85vh - 150px);
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.form-group.half {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--blue-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

#submit-form-btn {
    background: linear-gradient(135deg, var(--success-color), #45a049);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 5px;
}

#submit-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.form-footer {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

/* =========================================== */
/* MODAL DE COMPARTIR - FONDO DIFUMINADO */
/* =========================================== */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 21000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.share-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
}

.share-modal-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    border-radius: 20px 20px 0 0;
}

.share-modal-header h2 {
    color: white;
    margin: 0;
    font-size: 1.3rem;
}

.close-share-modal {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-share-modal:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.share-modal-body {
    padding: 15px 20px;
    color: white;
    overflow-y: auto !important;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(85vh - 130px);
}

.share-modal .progress-steps {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.share-modal .step-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.share-modal .step-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 5px;
    border: 2px solid transparent;
    font-size: 0.9rem;
}

.share-modal .step-item.completed .step-circle {
    background: #4CAF50;
    border-color: white;
}

.share-modal .step-item.active .step-circle {
    background: #FFD700;
    color: #333;
}

.share-modal .step-connector {
    flex: 0.5;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.share-modal .step-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
}

.share-step-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.share-description h3 {
    color: white;
    font-size: 1.1rem;
    margin: 0 0 5px;
}

.share-description p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 15px;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.share-btn i {
    font-size: 1.1rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-instructions {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.share-message {
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    margin-top: 10px;
    display: none;
    font-size: 0.85rem;
}

.share-message.success {
    display: block;
    background: rgba(76, 175, 80, 0.3);
    border: 1px solid #4CAF50;
}

.share-message.error {
    display: block;
    background: rgba(244, 67, 54, 0.3);
    border: 1px solid #f44336;
}

.share-modal-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.share-modal-footer .btn {
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    max-width: 200px;
    background: linear-gradient(to right, #4CAF50, #45a049);
    color: white;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* =========================================== */
/* SUCCESS MODAL */
/* =========================================== */
.success-message-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 24000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

.success-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    color: white;
    max-width: 400px;
    margin: 0 auto;
    max-height: 80vh;
    overflow-y: auto !important;
    position: relative;
    z-index: 24001;
}

.success-content i {
    font-size: 4rem;
    color: #4CAF50;
    margin-bottom: 15px;
}

.success-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.success-content p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.success-content .btn {
    margin-top: 20px;
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.success-content .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* =========================================== */
/* LOADING MODAL */
/* =========================================== */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 23000;
    overflow: hidden !important;
}

.loading-content {
    background: white;
    padding: 30px 40px;
    border-radius: 15px;
    text-align: center;
    z-index: 23001;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================== */
/* NOTIFICACIONES */
/* =========================================== */
.game-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 22000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.game-notification.show {
    transform: translateX(0);
}

.game-notification.warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

/* =========================================== */
/* FOOTER */
/* =========================================== */
.footer-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: -15px;
    overflow: visible;
    max-width: 100%;
}

.footer-image img {
    content: url('../img/footer.png');
    max-width: 180%;
    width: 180%;
    height: auto;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* Imagen de footer para móviles */
@media (max-width: 768px) {
    .footer-image img {
        content: url('../img/footer-moviles.png');
    }
}

/* =========================================== */
/* GRUPO DE ENTRADA PARA TELÉFONO */
/* =========================================== */
.phone-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.country-select {
    flex: 0 0 130px !important;
    min-width: 130px;
    background-color: white;
    cursor: pointer;
}

.country-select option {
    padding: 5px;
}

.phone-number {
    flex: 1 !important;
}

/* =========================================== */
/* PREVENCIÓN DE DESBORDAMIENTO HORIZONTAL */
/* =========================================== */
.form-modal *,
.share-modal *,
.result-modal *,
.success-message-modal *,
.loading-modal * {
    max-width: 100%;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* =========================================== */
/* ANIMACIONES */
/* =========================================== */
@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================== */
/* UTILIDADES */
/* =========================================== */
.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

.error {
    border-color: #dc3545 !important;
}

/* =========================================== */
/* MEDIA QUERY ESPECÍFICO PARA 1920x1080 */
/* =========================================== */
@media (min-width: 1919px) and (max-width: 1921px) and (min-height: 1079px) and (max-height: 1081px) {
    .main-wrapper {
        transform: scale(1.05);
        transform-origin: top center;
    }
    
    .floating-logo {
        transform: translate(-50%, 0) scale(1.08);
    }
    
    .logo-image {
        max-width: 240px;
    }
    
    .container {
        max-width: 720px;
        margin-top: 25px;
    }
    
    .game-container {
        max-width: 460px;
        min-height: 520px;
    }
    
    .game-instructions {
        font-size: 1.7rem;
        margin-top: 35px;
        padding-top: 65px;
    }
    
    .scratch-card-container {
        max-width: 360px;
        height: 250px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 1rem;
        max-width: 280px;
    }
    
    .footer-image img {
        max-width: 200%;
        width: 200%;
    }
}

/* =========================================== */
/* MEDIA QUERIES - MÓVILES */
/* =========================================== */
@media (max-width: 992px) {
    .main-wrapper::after {
        width: 400px;
        height: 400px;
        right: -100px;
        opacity: 0.5;
    }
    
    .footer-image img {
        max-width: 110%;
        width: 110%;
    }
}

@media (max-width: 768px) {
    .main-wrapper::after {
        display: none;
    }
    
    .footer-image {
        margin-top: -5px;
    }
    
    .footer-image img {
        max-width: 110%;
        width: 110%;
    }
    
    .logo-image {
        max-width: 180px;
    }
    
    .game-instructions {
        margin-top: 45px;
        padding-top: 50px;
        font-size: 1.3rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .form-group.half {
        width: 100%;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-container {
        padding: 15px;
        max-height: calc(80vh - 150px);
    }
    
    .prize-confirmation {
        padding: 12px;
    }
    
    .prize-confirmation h3 {
        font-size: 1.2rem;
    }
    
    #prize-confirmed {
        font-size: 1.5rem;
    }
    
    #submit-form-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .form-footer {
        margin-top: 12px;
        padding-top: 10px;
    }
    
    .country-select {
        font-size: 14px;
        padding: 10px;
    }
    
    /* Ajustes modales en móvil */
    .share-modal-content,
    .form-modal-content,
    .modal-content,
    .success-content {
        max-width: 92%;
        width: 92%;
        max-height: 80vh;
    }
    
    .modal-body {
        max-height: none;
    }
    
    .modal-content {
        max-width: 340px;
    }
    
    #result-title {
        font-size: 1.4rem;
    }
    
    .prize-result {
        font-size: 1.4rem;
    }
    
    .modal-footer .btn {
        min-width: 110px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .form-container {
        max-height: calc(80vh - 150px);
    }
    
    .share-modal-body {
        max-height: calc(80vh - 130px);
    }
    
    .share-modal-header {
        padding: 12px 15px;
    }
    
    .share-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .close-share-modal {
        font-size: 1.4rem;
        width: 32px;
        height: 32px;
    }
    
    .share-modal-body {
        padding: 12px 15px;
    }
    
    .share-modal .progress-steps {
        margin-bottom: 15px;
    }
    
    .share-modal .step-circle {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .share-modal .step-label {
        font-size: 9px;
    }
    
    .share-step-content {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .share-description h3 {
        font-size: 1rem;
    }
    
    .share-description p {
        font-size: 0.85rem;
    }
    
    .share-buttons {
        gap: 8px;
    }
    
    .share-btn {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 52px;
    }
    
    .share-btn i {
        font-size: 1.2rem;
    }
    
    .share-instructions {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .share-modal-footer {
        padding: 12px 15px;
    }
    
    .share-modal-footer .btn {
        padding: 12px 22px;
        font-size: 0.95rem;
    }
    
    .game-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        width: auto;
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .loading-content {
        width: 85%;
        max-width: 280px;
        padding: 20px;
    }
    
    .close-modal,
    .close-share-modal {
        min-width: 36px;
        min-height: 36px;
    }

    .btn,
    #submit-form-btn {
        min-height: 44px;
    }

    * {
        -webkit-tap-highlight-color: transparent;
    }
}

@media (max-width: 575px) {
    .game-container {
        padding: 12px;
        max-width: 340px;
    }
    
    .scratch-card-container {
        height: 180px;
        max-width: 240px;
    }
    
    .game-instructions {
        font-size: 1.1rem;
        padding-top: 30px;
        margin-top: 30px;
    }
    
    .footer-image {
        margin-top: 0;
    }
    
    .footer-image img {
        max-width: 120%;
        width: 120%;
    }
    
    .logo-image {
        max-width: 160px;
    }
    
    .phone-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .country-select {
        flex: 0 0 auto !important;
        width: 100%;
        min-width: 100%;
    }
    
    .phone-number {
        width: 100%;
    }
    
    .form-container {
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        margin-bottom: 4px;
        font-size: 0.85rem;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    #submit-form-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .form-footer p {
        font-size: 0.75rem;
    }
    
    .modal-content {
        max-width: 300px;
    }
    
    #result-title {
        font-size: 1.3rem;
    }
    
    .prize-result {
        font-size: 1.3rem;
    }
    
    .result-icon {
        font-size: 2rem;
    }
    
    .modal-footer {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    
    .modal-footer .btn {
        width: 100%;
        max-width: 180px;
    }
    
    .share-modal .step-circle {
        width: 28px;
        height: 28px;
    }
    
    .share-modal .step-label {
        font-size: 8px;
    }
    
    .share-btn {
        padding: 13px 14px;
        font-size: 0.95rem;
    }
}

@media (max-width: 375px) {
    .footer-image img {
        max-width: 130%;
        width: 130%;
    }
    
    .logo-image {
        max-width: 140px;
    }
    
    .game-instructions {
        margin-top: 30px;
        font-size: 1rem;
    }
    
    .prize-confirmation h3 {
        font-size: 1rem;
    }
    
    #prize-confirmed {
        font-size: 1.3rem;
    }
    
    .form-container {
        padding: 10px;
    }
    
    .form-group {
        margin-bottom: 8px;
    }
    
    .form-group label {
        margin-bottom: 3px;
        font-size: 0.8rem;
    }
    
    .form-control {
        padding: 7px 8px;
        font-size: 0.8rem;
    }
    
    #submit-form-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .form-footer {
        margin-top: 8px;
        padding-top: 6px;
    }
    
    .form-footer p {
        font-size: 0.7rem;
    }
    
    .modal-content {
        max-width: 260px;
    }
    
    #result-title {
        font-size: 1.2rem;
    }
    
    .prize-result {
        font-size: 1.2rem;
    }
    
    .result-icon {
        font-size: 1.8rem;
    }
    
    .share-modal-header h2 {
        font-size: 1rem;
    }
    
    .share-modal .step-circle {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }
    
    .share-btn {
        padding: 12px 12px;
        font-size: 0.9rem;
        min-height: 48px;
    }
    
    .share-btn i {
        font-size: 1.1rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .result-icon i {
        font-size: 2rem;
    }
    
    .success-content i {
        font-size: 2.5rem;
    }
    
    .success-content h3 {
        font-size: 1.1rem;
    }
}

/* =========================================== */
/* AJUSTES PARA iOS */
/* =========================================== */
@supports (-webkit-touch-callout: none) {
    input, 
    select, 
    textarea {
        font-size: 16px !important;
    }
    
    .form-modal-content,
    .share-modal-content,
    .modal-content,
    .success-content {
        max-height: -webkit-fill-available;
    }
}

/* WhatsApp Floating Button - Versión Mejorada */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    animation: whatsapp-appear 0.5s ease-out;
}

.whatsapp-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid white;
    background-color: white;
}

/* Efecto de pulso mejorado */
.whatsapp-float::before {
    content: '';
    position: absolute;
    width: 75px;
    height: 75px;
    background-color: rgba(37, 211, 102, 0.3); /* Color verde WhatsApp con transparencia */
    border-radius: 50%;
    animation: pulse 2s infinite;
    z-index: -1;
}

.whatsapp-float:hover::before {
    animation: pulse-hover 1.5s infinite;
}

/* Tooltip emergente */
.whatsapp-tooltip {
    position: absolute;
    right: 80px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
    border: 2px solid white;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #128C7E;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    right: 90px;
}

.whatsapp-float:hover .whatsapp-icon {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.4);
}

/* Efecto de brillo al pasar el mouse */
.whatsapp-float::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #25D366, #128C7E, #25D366);
    border-radius: 50%;
    z-index: -2;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(8px);
}

.whatsapp-float:hover::after {
    opacity: 0.6;
    animation: rotate 3s linear infinite;
}

/* Contador de mensajes (opcional) */
.whatsapp-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: bounce 2s infinite;
}

/* Animaciones */
@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.7;
    }
}

@keyframes pulse-hover {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.4;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

@keyframes whatsapp-appear {
    0% {
        transform: translateY(50px) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Responsive mejorado */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-icon {
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-float::before {
        width: 65px;
        height: 65px;
    }
    
    .whatsapp-tooltip {
        right: 70px;
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .whatsapp-float:hover .whatsapp-tooltip {
        right: 75px;
    }
}

@media (max-width: 480px) {
    .whatsapp-icon {
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-float::before {
        width: 60px;
        height: 60px;
    }
    
    .whatsapp-tooltip {
        display: none; /* Ocultar tooltip en móviles muy pequeños */
    }
}