/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.85) 0%, rgba(22, 36, 71, 0.85) 25%, rgba(27, 58, 107, 0.85) 50%, rgba(31, 71, 136, 0.85) 75%, rgba(30, 77, 146, 0.85) 100%),
                url('magic-wand-bg.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   ANIMATED BACKGROUND PARTICLES
   ========================================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.8) 0%, rgba(100, 200, 255, 0) 70%);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

.particle:nth-child(1) { width: 4px; height: 4px; top: 10%; left: 15%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { width: 6px; height: 6px; top: 20%; left: 80%; animation-delay: 2s; animation-duration: 15s; }
.particle:nth-child(3) { width: 3px; height: 3px; top: 60%; left: 10%; animation-delay: 4s; animation-duration: 18s; }
.particle:nth-child(4) { width: 5px; height: 5px; top: 80%; left: 70%; animation-delay: 1s; animation-duration: 14s; }
.particle:nth-child(5) { width: 4px; height: 4px; top: 30%; left: 50%; animation-delay: 3s; animation-duration: 16s; }
.particle:nth-child(6) { width: 7px; height: 7px; top: 50%; left: 85%; animation-delay: 5s; animation-duration: 13s; }
.particle:nth-child(7) { width: 3px; height: 3px; top: 70%; left: 30%; animation-delay: 2.5s; animation-duration: 17s; }
.particle:nth-child(8) { width: 5px; height: 5px; top: 15%; left: 45%; animation-delay: 4.5s; animation-duration: 11s; }
.particle:nth-child(9) { width: 4px; height: 4px; top: 85%; left: 20%; animation-delay: 1.5s; animation-duration: 19s; }
.particle:nth-child(10) { width: 6px; height: 6px; top: 40%; left: 90%; animation-delay: 3.5s; animation-duration: 15s; }
.particle:nth-child(11) { width: 3px; height: 3px; top: 25%; left: 65%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(12) { width: 5px; height: 5px; top: 55%; left: 40%; animation-delay: 4s; animation-duration: 16s; }
.particle:nth-child(13) { width: 4px; height: 4px; top: 75%; left: 55%; animation-delay: 1s; animation-duration: 13s; }
.particle:nth-child(14) { width: 6px; height: 6px; top: 35%; left: 25%; animation-delay: 3s; animation-duration: 18s; }
.particle:nth-child(15) { width: 3px; height: 3px; top: 65%; left: 75%; animation-delay: 5s; animation-duration: 12s; }
.particle:nth-child(16) { width: 5px; height: 5px; top: 90%; left: 50%; animation-delay: 2.5s; animation-duration: 17s; }
.particle:nth-child(17) { width: 4px; height: 4px; top: 45%; left: 15%; animation-delay: 4.5s; animation-duration: 11s; }
.particle:nth-child(18) { width: 7px; height: 7px; top: 5%; left: 35%; animation-delay: 1.5s; animation-duration: 19s; }
.particle:nth-child(19) { width: 3px; height: 3px; top: 95%; left: 85%; animation-delay: 3.5s; animation-duration: 15s; }
.particle:nth-child(20) { width: 6px; height: 6px; top: 50%; left: 60%; animation-delay: 5.5s; animation-duration: 14s; }

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(30px, -40px) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-20px, -80px) scale(0.9);
        opacity: 0.8;
    }
    75% {
        transform: translate(40px, -60px) scale(1.05);
        opacity: 0.5;
    }
}

/* ==========================================
   LIGHT STREAKS
   ========================================== */
.light-streaks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.streak {
    position: absolute;
    width: 2px;
    height: 150px;
    background: linear-gradient(to bottom, transparent, rgba(100, 200, 255, 0.6), transparent);
    animation: streak 8s infinite linear;
}

.streak:nth-child(1) { left: 20%; animation-delay: 0s; }
.streak:nth-child(2) { left: 60%; animation-delay: 3s; }
.streak:nth-child(3) { left: 80%; animation-delay: 6s; }

@keyframes streak {
    0% {
        top: -150px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ==========================================
   MAIN CONTAINER
   ========================================== */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* ==========================================
   HEADER
   ========================================== */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

.logo-image {
    max-width: 350px;
    width: 100%;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 30px rgba(255, 100, 255, 0.5));
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 100, 255, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(255, 100, 255, 0.8)) drop-shadow(0 0 60px rgba(100, 200, 255, 0.5));
    }
}

.subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
}

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

/* ==========================================
   GLASSMORPHIC CARD
   ========================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
        0 0 80px rgba(100, 200, 255, 0.2);
    padding: 60px;
    width: 100%;
    max-width: 900px;
    position: relative;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 32px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(100, 216, 255, 0.5), rgba(0, 163, 255, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   PHONE NUMBER PANEL
   ========================================== */
.number-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 24px;
    padding: 50px 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(100, 200, 255, 0.2);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.number-label {
    text-align: center;
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(100, 216, 255, 0.8);
    margin-bottom: 30px;
    font-weight: 600;
}

.phone-number {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 64px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #ffffff;
    text-align: center;
    min-height: 90px;
    position: relative;
}

.digit-group {
    display: flex;
    gap: 6px;
    position: relative;
}

.digit {
    display: inline-block;
    width: 50px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

/* Animation States */
.digit.revealed {
    color: #ffffff;
}

/* Group 1: Instant reveal with blue glow */
.digit-group.group-1 .digit.revealed {
    animation: instantReveal 0.6s ease-out forwards;
}

@keyframes instantReveal {
    0% {
        opacity: 0;
        transform: scale(0.5);
        color: rgba(100, 216, 255, 0.5);
    }
    50% {
        transform: scale(1.2);
        text-shadow: 
            0 0 20px rgba(100, 216, 255, 1),
            0 0 40px rgba(100, 216, 255, 0.8),
            0 0 60px rgba(100, 216, 255, 0.6);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        color: #ffffff;
        text-shadow: 
            0 0 10px rgba(100, 216, 255, 0.8),
            0 0 20px rgba(100, 216, 255, 0.5);
    }
}

/* Group 2: Slide in from right with light burst */
.digit-group.group-2 .digit.revealed {
    animation: slideInRight 0.8s ease-out forwards;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
        color: rgba(255, 255, 255, 0.3);
    }
    60% {
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
        color: #ffffff;
        text-shadow: 
            0 0 10px rgba(255, 200, 100, 0.8),
            0 0 20px rgba(255, 200, 100, 0.5);
    }
}

/* Group 3: Sparkle reveal with pulse glow */
.digit-group.group-3 .digit.revealed {
    animation: sparkleReveal 1s ease-out forwards;
}

@keyframes sparkleReveal {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
        color: rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
        text-shadow: 
            0 0 30px rgba(255, 100, 255, 1),
            0 0 60px rgba(255, 100, 255, 0.8),
            0 0 90px rgba(255, 100, 255, 0.6);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        color: #ffffff;
        text-shadow: 
            0 0 15px rgba(255, 100, 255, 0.8),
            0 0 30px rgba(255, 100, 255, 0.5);
    }
}

/* Sparkle Particles */
.sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkle 1s ease-out forwards;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--tx) * 1.5), calc(var(--ty) * 1.5)) scale(0);
    }
}

/* ==========================================
   STATUS MESSAGE
   ========================================== */
.status-message {
    text-align: center;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    min-height: 24px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.status-message.success {
    color: #64ff85;
    text-shadow: 0 0 10px rgba(100, 255, 133, 0.5);
    animation: pulse 1s ease-in-out;
}

.status-message.error {
    color: #ff6464;
    text-shadow: 0 0 10px rgba(255, 100, 100, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==========================================
   DRAW BUTTON
   ========================================== */
.draw-button {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    padding: 20px 40px;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(100, 216, 255, 0.3) 0%, rgba(0, 163, 255, 0.3) 100%);
    border: 2px solid rgba(100, 216, 255, 0.5);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.draw-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(100, 216, 255, 0.1), rgba(0, 163, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.draw-button:hover::before {
    opacity: 1;
}

.draw-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(100, 216, 255, 0.4),
        0 0 40px rgba(100, 216, 255, 0.3);
    border-color: rgba(100, 216, 255, 0.8);
}

.draw-button:active {
    transform: translateY(0);
}

.draw-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.button-icon {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.button-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, rgba(100, 216, 255, 0.5), rgba(0, 163, 255, 0.5));
    border-radius: 16px;
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0.3s ease;
    z-index: -1;
}

.draw-button:hover .button-glow {
    opacity: 0.6;
}

/* ==========================================
   STATS
   ========================================== */
.stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(100, 200, 255, 0.1);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #64d8ff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(100, 216, 255, 0.5);
}

.stat-divider {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, rgba(100, 200, 255, 0.3), transparent);
}

/* ==========================================
   RESET BUTTON
   ========================================== */
.reset-button {
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: block;
}

.reset-button:hover {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 100, 100, 0.3);
}

.reset-button:active {
    transform: translateY(0);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    text-align: center;
    margin-top: 40px;
    animation: fadeIn 1s ease-out 0.6s both;
}

.footer p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .glass-card {
        padding: 40px 30px;
    }

    .title {
        font-size: 36px;
    }

    .phone-number {
        font-size: 42px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .digit {
        width: 38px;
    }

    .digit-group {
        gap: 4px;
    }

    .draw-button {
        font-size: 18px;
        padding: 16px 32px;
    }

    .stats {
        flex-direction: column;
        gap: 20px;
    }

    .stat-divider {
        width: 80%;
        height: 1px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    .glass-card {
        padding: 30px 20px;
        border-radius: 24px;
    }

    .title {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
    }

    .phone-number {
        font-size: 32px;
        gap: 8px;
    }

    .digit {
        width: 30px;
    }

    .number-panel {
        padding: 30px 20px;
    }

    .draw-button {
        font-size: 16px;
        padding: 14px 28px;
    }

    .stat-value {
        font-size: 24px;
    }
}
