/* @kyc-managed v2 | sha=6f4bb8a8 | 2026-10-15T08:02:30+00:00 | by=claude */
/*
 * KYC Snowflakes - Frontend CSS
 * Styles for falling effects, contest icon, and prize modal
 */

/* ============================================================================
   CONTAINER
   ============================================================================ */

#kyc-snowflakes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

#kyc-snowflakes-container img {
    position: absolute;
    will-change: transform, opacity;
    user-select: none;
    -webkit-user-drag: none;
}

/* Drop styles: the silk line and the built-in spider (legs crawl while lowering, wiggle on the line, flail while falling). */
#kyc-snowflakes-container .kyc-sf-thread {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 0;
    will-change: transform, height;
}

#kyc-snowflakes-container .kyc-sf-spider svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.kyc-sf-spider .kyc-sf-body {
    fill: currentColor;
}

.kyc-sf-spider .kyc-sf-leg {
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kyc-sf-spider .kyc-sf-legs {
    transform-origin: 50px 52px;
    animation: kyc-sf-crawl-l 0.5s ease-in-out infinite alternate;
}

.kyc-sf-spider .kyc-sf-legs-r {
    animation-name: kyc-sf-crawl-r;
}

.kyc-sf-spider.is-hanging .kyc-sf-legs {
    animation-duration: 0.9s;
}

.kyc-sf-spider.is-falling .kyc-sf-legs {
    animation-duration: 0.09s;
}

.kyc-sf-spider.is-falling .kyc-sf-legs-l {
    animation-name: kyc-sf-flail-l;
}

.kyc-sf-spider.is-falling .kyc-sf-legs-r {
    animation-name: kyc-sf-flail-r;
}

/* Rise styles: ghosts and witches float up, turning to face the way they drift. */
#kyc-snowflakes-container .kyc-sf-riser svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.kyc-sf-riser .kyc-sf-face {
    width: 100%;
    height: 100%;
    transition: transform 0.35s ease-in-out;
}

.kyc-sf-ghost .kyc-sf-face svg {
    animation: kyc-sf-wobble 1.6s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.35));
}

.kyc-sf-ghost-body {
    fill: currentColor;
    stroke: rgba(0, 0, 0, 0.25);
    stroke-width: 1.5;
}

.kyc-sf-ghost-eye {
    fill: #2a2a2a;
}

.kyc-sf-witch .kyc-sf-face svg {
    animation: kyc-sf-tilt 1.2s ease-in-out infinite alternate;
}

.kyc-sf-witch-fill {
    fill: currentColor;
}

.kyc-sf-witch-broom {
    fill: none;
    stroke: currentColor;
    stroke-width: 3.5;
    stroke-linecap: round;
}

@keyframes kyc-sf-wobble {
    from { transform: rotate(-5deg) skewX(3deg); }
    to { transform: rotate(5deg) skewX(-3deg); }
}

@keyframes kyc-sf-tilt {
    from { transform: rotate(-6deg) translateY(1px); }
    to { transform: rotate(3deg) translateY(-2px); }
}

@keyframes kyc-sf-crawl-l {
    from { transform: rotate(-7deg) scaleX(1); }
    to { transform: rotate(5deg) scaleX(0.94); }
}

@keyframes kyc-sf-crawl-r {
    from { transform: rotate(7deg) scaleX(1); }
    to { transform: rotate(-5deg) scaleX(0.94); }
}

@keyframes kyc-sf-flail-l {
    from { transform: rotate(-18deg) scaleX(1.06); }
    to { transform: rotate(14deg) scaleX(0.86); }
}

@keyframes kyc-sf-flail-r {
    from { transform: rotate(18deg) scaleX(1.06); }
    to { transform: rotate(-14deg) scaleX(0.86); }
}

/* ============================================================================
   CONTEST ICON
   ============================================================================ */

#kyc-contest-icon {
    position: fixed;
    cursor: pointer;
    pointer-events: auto;
    transition: filter 0.3s ease;
    z-index: 99999;
}

#kyc-contest-icon:hover {
    filter: brightness(1.2) drop-shadow(0 0 30px currentColor);
}

#kyc-contest-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes kyc-contest-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

@keyframes kyc-contest-glow {
    0%, 100% {
        filter: drop-shadow(0 0 20px var(--glow-color, #FFD700));
    }
    50% {
        filter: drop-shadow(0 0 40px var(--glow-color, #FFD700));
    }
}

/* ============================================================================
   PRIZE MODAL
   ============================================================================ */

#kyc-contest-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: kyc-modal-fade-in 0.3s ease;
}

@keyframes kyc-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.kyc-modal-content {
    background: linear-gradient(145deg, #1a1d21 0%, #2c3338 100%);
    color: #fff;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 
                0 0 60px rgba(255, 215, 0, 0.2);
    animation: kyc-modal-scale-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes kyc-modal-scale-in {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.kyc-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #8c8f94;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.kyc-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.kyc-modal-content h2 {
    font-size: 28px;
    margin: 0 0 15px 0;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.kyc-modal-content p {
    font-size: 16px;
    color: #bbc8d4;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

/* Prize Code */
.kyc-prize-code {
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
}

.kyc-prize-code span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8c8f94;
    margin-bottom: 10px;
}

.kyc-prize-code code {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #FFD700;
    letter-spacing: 3px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.kyc-copy-code {
    background: #FFD700;
    color: #1a1d21;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kyc-copy-code:hover {
    background: #fff;
    transform: scale(1.05);
}

/* Prize Value */
.kyc-prize-value {
    font-size: 36px !important;
    font-weight: 700;
    color: #4ECDC4 !important;
    margin: 20px 0 !important;
}

.kyc-prize-points {
    font-size: 24px !important;
    font-weight: 600;
    color: #96E6A1 !important;
}

.kyc-prize-expiry {
    font-size: 13px !important;
    color: #8c8f94 !important;
    margin-top: 15px !important;
}

/* Modal Button */
.kyc-modal-button {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1d21;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
}

.kyc-modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

/* Loading State */
.kyc-modal-loading {
    padding: 40px;
}

.kyc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: kyc-spin 1s linear infinite;
}

@keyframes kyc-spin {
    to {
        transform: rotate(360deg);
    }
}

.kyc-modal-loading p {
    color: #bbc8d4;
    font-size: 16px;
}

/* ============================================================================
   CONFETTI
   ============================================================================ */

.kyc-confetti {
    position: fixed;
    pointer-events: none;
    z-index: 9999999;
}

/* ============================================================================
   ACCUMULATED ITEMS
   ============================================================================ */

.kyc-accumulated-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    overflow: hidden;
}

.kyc-accumulated-item {
    position: absolute;
    bottom: 0;
}

/* ============================================================================
   NEAR-MISS MESSAGE
   ============================================================================ */

.kyc-near-miss {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #FFD700;
    padding: 30px 50px;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    z-index: 999998;
    animation: kyc-near-miss-anim 3s ease forwards;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

@keyframes kyc-near-miss-anim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media screen and (max-width: 600px) {
    .kyc-modal-content {
        padding: 30px 20px;
        margin: 15px;
    }
    
    .kyc-modal-content h2 {
        font-size: 22px;
    }
    
    .kyc-prize-code code {
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    .kyc-prize-value {
        font-size: 28px !important;
    }
    
    #kyc-contest-icon {
        max-width: 80px;
        max-height: 80px;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    #kyc-contest-icon,
    .kyc-modal-content,
    #kyc-contest-modal,
    .kyc-spinner {
        animation: none;
    }
    
    #kyc-snowflakes-container {
        display: none;
    }
}

/* ============================================================================
   HIGH CONTRAST MODE
   ============================================================================ */

@media (prefers-contrast: high) {
    .kyc-modal-content {
        background: #000;
        border: 2px solid #fff;
    }
    
    .kyc-prize-code {
        border: 2px solid #FFD700;
    }
    
    .kyc-modal-button {
        border: 2px solid #000;
    }
}

