* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            width: 100vw;
            height: 100vh;
            overflow: hidden;

background: #cc7a06;
background: linear-gradient(131deg,rgba(204, 122, 6, 1) 0%, rgba(207, 160, 52, 1) 53%, rgba(196, 95, 18, 1) 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            font-family: "Momo Trust Display",Arial, sans-serif;
        }
        #canvasContainer {
            position: relative;
        }
        @media (min-width: 700px) {
            #canvasContainer {
                padding: 10px;
                background: white;
                border-radius: 20px;
                box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            }
            canvas {
                border-radius: 10px;
            }
        }
        canvas {
            display: block;
            background: #f1f2eb;
        }
        
    
        #controls {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 20px;
            z-index: 10;
            touch-action: none;
        }
        #timer {
            position: fixed;
            background: white;
            color: #333333;
            padding: 8px 14px;
            min-width:83px;
            border-radius: 6px;
            border: 2px solid #dfe1d2;
            font-size: 16px;
            font-weight: normal;
            font-family: "Momo Trust Display",Arial, sans-serif;
            z-index: 10;
        }
        #levelIndicator {
            position: fixed;
            background: white;
            color: #333333;
            padding: 8px 14px;
            border-radius: 6px;
            border: 2px solid #dfe1d2;
            font-size: 16px;
            font-weight: normal;
            font-family: "Momo Trust Display", Arial, sans-serif;
            display: flex;
            align-items: center;
            gap: 8px;
            z-index: 10;
            cursor: pointer;
            transition: background 0.2s;
            touch-action: none;
        }
        #levelIndicator:hover {
            background: #f0f0f0;
        }
        #levelSwitcher {
            font-size: 18px;
                display: flex;
    align-items: center;
    justify-content: center;
        }
        #levelModal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 100;
            touch-action: none;
        }
        #levelModal.active {
            display: flex;
        }
        #completionModal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.2);
            display: none;
            justify-content: center;
            align-items: flex-start !important;
            padding-top: 80px;
            padding-bottom: 40px;
            z-index: 200;
            pointer-events: none;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        #completionModal.active {
            display: flex;
        }
        
        #lottieContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    pointer-events: none;
}

#lottieAnimation {
    width: 80vw;
    max-width: 980px;
    height: 80vw;
    max-height: 980px;
}


        #completionContent {
            background: white;
            border-radius: 10px;
            padding: 15px 25px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            pointer-events: auto;
            touch-action: auto;
            text-align: center;
            max-height: 85vh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        #completionContent .checkmark {
            font-size: 24px;
            color: #23b26b;
        }
        #completionContent .message {
            color: #333333;
            font-size: 16px;
        }
        #nextBtn {
            background: #669933;transistion:all 0.3s;
            color: white;
            border: none;
            padding: 8px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            
            transition: background 0.2s;
            touch-action: none;
            font-family: "Momo Trust Display",Arial;
        }
        #nextBtn:hover {
            background: #444;transistion:all 0.3s;
        }
        #levelList {
            background: white;
            border-radius: 20px;
            padding: 30px;
            max-width: 400px;
            width: 90%;
            touch-action: none;
        }
        #levelList h2 {
            margin: 0 0 20px 0;
            color: #333333;
            text-align: center;
        }
        #levelButtons {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
        }
        
        .share-btn:hover {
    background: #444 !important;transition:all 0.3s;
}

        .levelBtn {
            background: #f0f0f0;
            padding: 15px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            border: 3px solid transparent;
            text-align: center;
            font-size: 18px;
          
            color: #333333;
            
        }
        .levelBtn:hover {
            background: #e0e0e0;
            transform: scale(1.05);
        }
        .levelBtn.current {
            border-color: #667eea;
            background: #e8ebfa;
        }
        .levelBtn.locked {
            background: #d0d0d0;
            color: #999;
            cursor: not-allowed;
            opacity: 0.5;
        }
        .levelBtn.locked:hover {
            background: #d0d0d0;
            transform: none;
        }
        .levelBtn.completed {
            background: #d4f4dd;
            border-color: #23b26b;
        }
.btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #333;
    border: none;
    cursor: pointer;
    font-size: 24px;
   
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
    transition: transform 0.1s, box-shadow 0.1s;
    color: #ffffff; /* This ensures any text or unstyled SVG path is white */
    display: flex;
    align-items: center;
    justify-content: center;
}
        .btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
        }
        .btn:active {
            transform: scale(0.95);
        }
        #introModal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.0);
            display: none;
            justify-content: center;
            align-items: flex-start;
            padding-top: 60px;
            z-index: 150;
            pointer-events: none;
            touch-action: none;

        }
        #introModal.active {
            display: flex;
        }
        #introContent {
            background: rgba(255,255,255,0.7);
            border-radius: 20px;
            padding: 22px 40px 10px 25px;
            max-width: 295px;
            width: 95%;
            position: relative;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            cursor: move;
            pointer-events: auto;
        }
        #introContent .closeBtn {
            position: absolute;
            top: 7px;
            right: 7px;
            background: none;
            border: none;
            font-size: 29px;
            color: #888;
            cursor: pointer;
            line-height: 1;
            padding: 0;
            width: 25px;
            height: 25px;
        }
        #introContent .closeBtn:hover {
            color: #333;
        }
        #introContent .introText {
            color: #333333;
            font-size: 18px;
            line-height: 1.6;
            margin-bottom: 14px;
        }
        #introContent .startBtn {display:none;
            background: #669933;
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 16px;
            
            width: 100px;
            transition: background 0.2s;
        }
        #introContent .startBtn:hover {
            background: #444;
        }
/* Mobile responsive styles */
@media (max-width: 600px) {
    #completionContent {
        padding: 20px;
        
        max-width: 340px;
        max-height: 80vh;
    }
    
    #ratingSection {
        padding: 15px;
        width: 100%;
    }
    
    .rating-label {
        font-size: 14px;
    }
    
    .stars {
        font-size: 28px;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .difficulty-btn {
        width: 100%;
        padding: 12px;
    }
    
    #shareBtn, #goHomeBtn {
        width: 100%;
        padding: 14px;
        margin: 5px 0;
    }
    
    .stat-line {
        font-size: 18px;
    }
    
    #statsDisplay {
        width: 100%;
    }
}

@media (max-height: 700px) {
    #completionContent {
        padding: 15px;
        max-height: 95vh;
    }
    
    #ratingSection {
        margin: 15px 0;
        padding: 12px;
    }
    
    .stars {
        font-size: 24px;
    }
}

@media (max-height: 700px) {
    canvas {
        margin-top: -4px;
    }
}

@media (max-width: 600px), (max-height: 700px) {
    #playLogo {
        transform: scale(0.7);
        transform-origin: bottom right;
        bottom: 20px !important;
    }
}

/* Fix horizontal scrolling */
#completionContent {
    overflow-x: hidden !important;
    
    max-width: 340px;
}

/* Mobile compressed layout */
@media (max-width: 600px) {
    #completionContent {
        padding: 15px;
        gap: 10px;
    }
    
    /* Checkmark and title on one line */
    .checkmark {
        display: inline;
        margin-right: 8px;
        font-size: 20px;
    }
    
    .message {
        display: inline;
        font-size: 16px;
    }
    
    /* Time and Moves on one line */
    #statsDisplay {
        display: flex;
        gap: 10px;
        justify-content: center;
        align-items: center;
        margin: 5px 0;
    }
    
    .stat-line {
        font-size: 16px;
        margin: 0;
    }
    
    .stat-line:first-child::after {
        content: " •";
        margin-left: 5px;
    }
    
    /* Rating section more compact */
    #ratingSection {
        padding: 10px;
        margin: 5px 0;
        gap: 10px;
    }
    
    #starRating {
        margin-bottom: 0;
    }
    
    .rating-label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .stars {
        font-size: 24px;
    }
    
    /* Difficulty buttons horizontal and smaller */
    .difficulty-buttons {
        flex-direction: row !important;
        justify-content: space-between;
        gap: 5px;
    }
    
    .difficulty-btn {
        width: auto !important;
        flex: 1;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Buttons */
    #shareBtn, #goHomeBtn {
        width: 100%;
        padding: 12px;
        margin: 3px 0;
        font-size: 15px;
    }
}

/* Modal container handles scrolling */
#completionModal {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    align-items: flex-start !important;
    padding: 60px 20px 40px 20px !important;
}

/* Content box can be full height, no overflow on itself */
#completionContent {
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    margin: 0 auto;
}

@media (max-width: 600px) {
    #completionModal {
        padding: 40px 10px 40px 10px !important;
    }
    
    #completionContent {
        overflow: visible !important;
          gap: 8px !important;
    }
}

@media (max-width: 600px) {
    #statsDisplay {
        display: flex;
        gap: 2px;
        justify-content: center;
        align-items: center;
     margin: 0 !important;
        padding: 3px 0 !important;
    }
    
    .stat-line {
        font-size: 15px;  /* Reduced from 16px */
        margin: 0;
    }
    
    #shareBtn {
        margin-bottom: 0px !important;
    }
    
}

@media (max-width: 600px), (max-height: 700px) {
    #introModal {
        padding-top: 10px !important;
    }
    
    #introContent {
        padding: 10px 16px 20px 16px !important;
        gap: 0 !important;
    }
    
    #introLogo {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        height: auto !important;
        max-height: 180px !important;
    }
    
    #averageTime {
        margin: 10px 0 !important;
        font-size:18px !important;
    }
    
    #playBtn {
        margin-top: 20px !important;margin-bottom:30px; !important;
    }
}

   
  #playLogo {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 100;
    opacity: 0.6;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

#playLogo:hover {
    opacity: 1;
    transform: scale(1.1);
}

#playLogo img {
    width: 110px;
    display: block;
}

     #moveCounter {
    position: fixed;
    top: 10px;
    left: 130px;  /* Position it to the right of timer */
    font-family: 'Momo Trust Display', monospace;
    font-size: 16px;  /* Match timer */
     font-weight: normal;
    color: #333333;  /* Match timer */
     border: 2px solid #dfe1d2;
    background: white;  /* Match timer */
    padding: 8px 14px;  /* Match timer */
    border-radius: 6px;  /* Match timer */
    z-index: 100;
}

      
        
        
        
        #statsDisplay {
            margin: 20px 0;
            font-size: 20px;
          
        }
        
        .stat-line {
            margin: 10px 0;
        }
        
        #shareBtn {
            background: #31a3a3;
            color: white;
            border: none;
            padding: 12px 24px;
            font-size: 16px;
            border-radius: 8px;
            cursor: pointer;
            margin: 10px 5px;
            font-family: 'Momo Trust Display', sans-serif;
        }
        
        #shareBtn:hover {
            background: #258888;
        }
        
     /* Intro Modal Styles */
#introModal {
    position: fixed;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);  /* Semi-transparent overlay */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#introModal.active {
    display: flex;
}

#introContent {
    background: #262626;
    top:-30px;
    text-align: center;
    padding: 20px 40px 46px 40px;
    max-width: 600px;
    width: 90%;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#introLogo {
    width: 400px;
    height: 240px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 10px;
}
    .daily-fact {color:#999;margin-top:30px;border-top:1px solid #555;padding-top:20px;}
    .daily-fact-header {color:#ccc;margin-bottom:5px;}
     .daily-fact-text {max-width:430px;line-height:25px;}

#averageTime {
    color: #ddd;  /* Changed from white */
    font-family: 'Momo Trust Display', sans-serif;
    font-size: 20px;
    margin-bottom: 30px;
}

#avgTimeValue {
   
    color: #de9236;
}

#playBtn {
    background: white;
    color: #222222;
    border: none;
    padding: 16px 48px;
    font-size: 24px;
  
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Momo Trust Display', sans-serif;
    transition: background 0.3s ease;
}

#playBtn:hover {
    background: #de9236;
    color: white;
}
        
        /* Rating System Styles */
        #ratingSection {
            margin: 20px 0;
            padding: 20px;
            background: #f5f5f0;
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .rating-label {
            font-size: 16px;
            margin-bottom: 10px;
            color: #333;
        }
        
        #starRating {
            margin-bottom: 0;
        }
        
        #difficultyRating {
            margin-top: 0;
        }
        
        .stars {
            font-size: 36px;
            cursor: pointer;
            user-select: none;
        }
        
        .star {
            color: #ddd;
            transition: color 0.2s;
            margin: 0 2px;
        }
        
        .star:hover,
        .star.active {
            color: #de9236;
        }
        
        .difficulty-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        .difficulty-btn {
            background: white;
            color: #333;
            border: 2px solid #ddd;
            padding: 10px 24px;
            font-size: 16px;
            border-radius: 8px;
            cursor: pointer;
            font-family: 'Momo Trust Display', sans-serif;
            transition: all 0.3s ease;
        }
        
        .difficulty-btn:hover {
            border-color: #de9236;
        }
        
        .difficulty-btn.selected {
            background: #de9236;
            color: white;
            border-color: #de9236;
        }
        
        /* Mobile Modal Scrolling */
        #introModal, #completionModal {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 20px;
        }
        
        /* Make modal content scrollable with max height */
        #introContent, #completionContent {
            max-height: 90vh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        
        /* Lock background body scroll when modal is open */
        body.modal-open {
            overflow: hidden;
          
            width: 100%;
        }
        
        /* Mobile responsive styles */
        @media (max-width: 600px) {
            #completionContent {
                padding: 20px;
                max-height: 95vh;
            }
            
            #ratingSection {
                padding: 15px;
            }
            
            /* Stack rating sections vertically on mobile */
            #starRating, #difficultyRating {
                margin-bottom: 20px;
            }
            
            .rating-label {
                font-size: 14px;
            }
            
            .stars {
                font-size: 28px;
            }
            
            .difficulty-buttons {
                flex-direction: column;
                gap: 8px;
            }
            
            .difficulty-btn {
                width: 100%;
                padding: 12px;
            }
            
            #shareBtn {
                width: 100%;
                padding: 14px;
            }
            
            .stat-line {
                font-size: 18px;
            }
        }
        
        @media (max-height: 700px) {
            #completionContent {
                padding: 15px;
                max-height: 95vh;
            }
            
            #ratingSection {
                margin: 15px 0;
                padding: 12px;
            }
            
            .stars {
                font-size: 24px;
            }
        }
        
#pauseOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    background: rgba(0, 0, 0, 0.1);
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}

#pauseOverlay.active {
    opacity: 1;
}

#timer, #levelIndicator {
    z-index: 100;
    position: fixed;
}
#timer {min-width:112px;}

#pauseIcon, #playIcon {
    transition: opacity 0.2s;
}

#timer:hover #pauseIcon,
#timer:hover #playIcon {
    opacity: 0.7;
}

/* Custom Tooltips */
.btn {
    position: relative;
}

.btn::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    background: #333333;
    color: white;
    padding: 5px 7px;  /* Reduced from 8px 12px */
    border-radius: 6px;
    font-size: 11.3px;  /* Reduced from 14px */
    font-family: 'Momo Trust Display', sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 6px solid transparent;
    border-top-color: #333333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
}

.btn:hover::before,
.btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4);
}

.btn:hover::after {
    transform: translateX(-50%) translateY(0px);
}

#introModal {
    ...existing styles...
    transition: opacity 0.3s ease;
}

#introModal.active {
    display: flex;
    opacity: 1;
}

#dragHandle {
    position: absolute;
    top: 12px;
    left: 12px;
    cursor: move;
    opacity: 0.4;
    transition: opacity 0.2s;
}

#dragHandle:hover {
    opacity: 0.7;
}

#completionContent {
    position: relative;
}

/* Make difficulty buttons smaller and fit on one line */
.difficulty-btn {
    background: white;
    color: #333;
    border: 2px solid #ddd;
    padding: 8px 16px;  /* Reduced from 10px 24px */
    font-size: 14px;    /* Reduced from 16px */
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Momo Trust Display', sans-serif;
    transition: all 0.3s ease;
}

.difficulty-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;  /* Changed from wrap to nowrap */
}

/* Reduce padding around stats */
#statsDisplay {
    margin: 15px 0;  /* Reduced from 20px */
    font-size: 20px;
}

.stat-line {
    margin: 6px 0;  /* Reduced from 10px */
}

#ratingSection {
    margin: 15px 0;  /* Reduced from 20px */
    padding: 15px;   /* Reduced from 20px */
    background: #f5f5f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;  /* Reduced from 20px */
}
#completionContent {min-width:280px;}
#controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* iOS safe area */
    margin-bottom: 10px; /* Extra margin for safety */
}

/* Mobile adjustments */
@media (max-height: 700px) {
    #controls {
        bottom: 10px;
        margin-bottom: 5px;
    }
}
.btn.tooltips-disabled::before,
.btn.tooltips-disabled::after {
    display: none !important;
}

.btn.show-tooltip::before,
.btn.show-tooltip::after {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(-10px) !important;
}

.btn.show-tooltip::after {
    transform: translateX(-50%) translateY(-6px) !important;
}