*:not(.pixel-roof .sqaure-container .notification-modal ) {
    touch-action: manipulation;
}

body.no-scroll {
    width: 100%;
}

body.no-zoom {
    touch-action: none;
    -webkit-user-select: none; /* Disable text selection on iOS Safari */
    -webkit-touch-callout: none; /* Disable callout, e.g., when tap and hold */
    user-select: none;
}

body.no-horizontal-scroll {
    overflow-x: hidden;

}

body.no-vertical-scroll, html.no-vertical-scroll{
    overflow: hidden;
    position: fixed; 
    touch-action: none;
    -ms-touch-action: none;
    width: 100%;
    height: 100%;
}



main {
    display: flex;
    flex-direction: row !important;
    align-items: flex-start;
    position: relative;
    box-sizing: border-box;
    padding: 8px !important;




}

#panelTitle {
    padding: 0 8%;
    font-size: 3.5vh;
    text-align: center;
}


.creator-info:hover {
    color: var(--contrast-color); /* Adjust to a high-contrast color */
    transition: transform 0.3s ease-in-out, color 0.3s ease;
}

.creator-info a {
    text-decoration: none;
    color: inherit;
    cursor: cell;
}




.gallery {
    touch-action: manipulation;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 80px;
    flex-grow: 1;
    margin-top: 50px;
    
}

.gallery-item {
    position: relative;
    cursor: cell;
    align-self: center;
}

.gallery-item.skeleton {
    /* Base for responsive sizing */
    aspect-ratio: 1 / 1; /* Maintains a square shape based on grid column width */
    
    position: relative; /* Crucial for positioning the ::before pseudo-element */
    overflow: hidden; /* Good practice to ensure no overflow */

    /* The main background of the skeleton itself (the "transparent" part) */
    background-color: transparent; 

    /* No animation on the parent .skeleton element itself, it just holds the space */
    animation: none; /* Ensure no existing animation is overriding */
}

/* The NEW element for the 16x16px pulsating square */
.gallery-item.skeleton::before {
    content: ''; /* Required for pseudo-elements */
    position: absolute; /* Position it relative to the parent skeleton item */
    width: 16px; /* Fixed size */
    height: 16px; /* Fixed size */

    /* Center it perfectly within the skeleton item */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centers the element itself */

    /* Initial color of the small square */
    background-color: var(--text-color1-t); 

    /* Apply the pulsation animation to this small square */
    animation: skeleton-pulse 1.5s infinite alternate; 
}

/* Define the keyframes for the pulsation (this can remain the same) */
@keyframes skeleton-pulse {
    0% {
        background-color: var(--text-color1-t); /* Starting color */
    }
    100% {
        background-color: var(--text-color2-t); /* Ending color */
    }
}



.gallery img {
    
    width: auto;
    height: 128px;
    object-fit: contain;
    image-rendering: pixelated;
    transition: transform 0.1s ease-in;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: auto;
    margin-bottom: auto;
    max-width: 128px;
    max-height: 128px;
    border-radius: 8px;
}



.gallery-item.liked .like-button {
    display: block;
    transform: scale(1.1);

}

.gallery-item.selected {
    border: 4px solid var(--text-color);
}

/* Hover effect for desktop */
@media (hover: hover) and (pointer: fine) {
    .gallery-item:hover img {
        transform: scale(1.05);
        z-index: 1;
    }

    .gallery-item:hover .like-button {
        display: block;
        transform: scale(1.1);
    }

    .gallery-item.selected {
        transition: transform 0.2s ease-in;
        transform: scale(0.8);
    }
    
    .gallery-item.selected img {
        transform: scale(1.6);
    
    }
}




.like-button {
    position: absolute;
    top: 5%;
    right: 5%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    cursor: cell;
    display: none;
    transition: transform 0.2s ease-in;
    opacity: 0.8;
}

.like-button img {
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

.like-button:hover {
    opacity: 1;
    scale: 1.2;
}


.like-animation-floater {
    position: absolute; /* Allows placement anywhere on the page */
    z-index: 9999;      /* Ensures it's on top of everything */
    pointer-events: none; /* The floater can't be clicked */

    /* --- Visual styles copied directly from your original .like-count --- */
    color: white;
    padding: 10px;
    font-size: calc(0.5rem + 1vw);
    font-weight: bolder;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 
        -1px -1px 0 #000, 1px -1px 0 #000,
        -1px 1px 0 #000, 1px 1px 0 #000,
        -1px 0 0 #000, 1px 0 0 #000,
        0 -1px 0 #000, 0 1px 0 #000;
    
    /* --- It now triggers your existing animation --- */
    animation: scale-up 3s forwards;
}


/* 2. This is the original .like-count, now simplified. 
      It's just a hidden placeholder that the JavaScript reads from. */
.like-count {
    display: none; /* It should always be hidden */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* Keep the visual styles so JS can measure its position correctly before it's hidden */
    color: white;
    padding: 10px;
    font-size: calc(0.5rem + 1vw);
    font-weight: bolder;
    z-index: 100;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 
        -1px -1px 0 #000, 1px -1px 0 #000,
        -1px 1px 0 #000, 1px 1px 0 #000,
        -1px 0 0 #000, 1px 0 0 #000,
        0 -1px 0 #000, 0 1px 0 #000;
}


/* 3. Your keyframes remain UNCHANGED and are now used by the floater. */
@keyframes scale-up {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -50%) scale(4) translateY(-20px);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4) translateY(-300px);
    }
   
}

.side-panel {
    position: fixed;
    top: 0;
    right: -400px;
    max-width: 400px;
    width: 100%;
    height: 100dvh;
    transition: right 0.1s ease-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    backdrop-filter: blur(20px);
    background-color: var(--text-color2-t);



}




.side-panel.active {
    right: 0;

}






.image-link {
    font-size: 3dvh;
    font-weight: normal;
    margin-top: 5dvh;
    margin-bottom: 15px;
    text-align: center;
    padding-inline: 20px;
    text-decoration: none; /* Remove underline */
    color: var(--text-color); /* Use text color from your theme */
    cursor: cell; /* Set cursor to cell */
}

.image-link:hover {
    color: var(--contrast-color); /* Use contrast color on hover */
}

.panel-image {
    height: 30vh;
    width: 30vh;
    object-fit: contain;
    max-width: 768px;
    max-height: 768px;
    margin-top: 4vh;
    image-rendering: pixelated;
}

#panelImage[src=""] {
    display: none;
}






.creator-info {
    font-family: 'Press Start 2P', cursive;
    font-weight: normal;
    font-size: 1.2vh;
    display: flex;
    text-align: left;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-top: 0;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 150px;
    padding: 0 20%;

}

.side-panel .creator-info img {
    width: 5dvh;
    height: 5dvh;
    margin-right: 10px;

}

.gallery-margin {
    width: 0px;
    background-color: rgba(0, 0, 0, 0);
    transition: width 0.3s ease-in;
}



.close-button {
    top: 2%;
    left: 20px;
    position: absolute;
    background-color: var(--text-color);
    color: var(--text-color2);
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    border: none;
    cursor: cell;
    max-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    scale: 1.2;
}





.color-palette {
    display: flex;
    flex-direction: row;
    align-items:center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 380px;
    margin-bottom: 16px;
    padding: 0px 48px;
    margin-top:16px;

}

.color-palette div {
    width: 16px;
    height: 16px;
}

.stats-row {
    
    display:flex;
    justify-content:space-evenly;
    vertical-align: middle;
    align-items: flex-start;
    background-color: black;
    color: white;
    padding: 3%;
    gap: 2vw;
    width: 35%;
    border-radius: 8px;
}

.stat-item {
    flex-grow: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

}

.stat-item img {
    margin-top: 5px;
    margin-bottom: 5px;
    width: 50%;
    height: 50%;
}

.stat-item span {
    font-size: 16px;
}
.stat-item.coins-count span {
    font-size: 16px;
}

.stat-item:hover {
    transform: scale(1.1);
}

.stat-coin img {
    min-width:32px !important;
}

.stat-like img {
    min-width:32px !important;
}


/* Flex container for buttons */
.button-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    position: absolute;
    bottom: 7%;
    left: 0;
}

.icon-btn {
    width: 36px !important;
    height: 36px !important;
    cursor: cell;
    transition: transform 0.3s ease;
    margin: 5px;
    position: relative;
    display: inline-block;
    text-align: center;
    margin-top: 0 !important;
    gap: 16px;
}

.icon-btn svg {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2; /* Ensure the image is above the square */
    image-rendering: pixelated;
}

.icon-btn:hover svg {
    color: var(--contrast-color)
}




.tooltip {
    visibility: hidden;
    opacity: 0;
    width: 120px;
    color: var(--contrast-color);
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 3; /* Ensure the tooltip is above the image and square */
    bottom: -16px; /* Adjust this value as needed */
    left: 50%;
    margin-left: -60px;
    transition: opacity 0.3s;
    font-size: 8px;
}

.icon-btn:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.icon-btn:hover {
    transform: scale(1.3);
}







.collect-btn {
    width: auto;
    cursor: cell;
    transition: transform 0.3s ease;
    margin: 5px;
    background-color: var(--text-color2) !important;
    color: var(--text-color) !important;
    border: 4px solid var(--text-color);
    display: inline-flex;
    align-items: center;
    padding: 0.5vh 5%;
    font-size: 1.5vh;
    border-radius: 8px;
    font-family: 'Press Start 2P', cursive;

}

.collect-btn img {
    margin-left: 20px; /* Added margin to the left of the icon */
    margin-right: -10px; /* Added margin to the left of the icon */

    width: 3vh; /* Adjusted icon width */
    height: 3vh; /* Adjusted icon height */
    vertical-align: middle;
}

.collect-number {
    margin-left: 10px; /* Added margin to the left of the number */
    font-size: 1.2vh; /* Adjusted font size for the number */
}

.collect-btn:hover {
    transform: scale(1.2);
    color: var(--contrast-color) !important;
    border: 4px solid var(--contrast-color);
}



.has-tooltip {
    position: relative;
    cursor: cell;
}

.custom-tooltip {
    position: fixed;
    top: 55%; /* Adjust as needed */
    right: 420px; /* Adjust to position tooltip as required */
    background-color: var(--text-color2); /* Use your custom background color */
    color: var(--text-color); /* Use your custom text color */
    padding: 20px; /* Custom padding */
    border-radius: 6px; /* Rounded corners */
    white-space: normal; /* Allow text to wrap */
    max-width: 50vw; /* Control maximum width */
    width: max-content;
    border: 2px solid var(--text-color); /* Custom border */
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.5;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    display: none;
}

.has-tooltip:hover .custom-tooltip {
    display: block;
    opacity: 1;
}

.tooltip-seed {
    color: var(--contrast-color); /* Use contrast color for seed */
    font-weight: bold;
}

.info-container {
    display: flex;
    gap: 16px; /* Adjust spacing between squares */
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.info-square {
    display: none; /* Initially hidden */
    border: 2px solid var(--text-color);
    color: var(--text-color);
    background-color: var(--text-color2);
    padding: 5px 10px; /* Adjust padding for the desired size */
    text-align: center;
    font-size: 8px;
    font-weight: bold;
    white-space: nowrap; /* Prevent text from wrapping */
    font-family: 'Press Start 2P', cursive;

}

.btn-moderate {
    width: fit-content;
    padding: 10px;
    display: none;
    position: absolute;
    top: 15px;
    right: 420px;
}




@media (max-width: 768px) {

    #panelTitle {
        font-size: 24px;
    }

    .panel-image {
       
        margin-top: 1vh;
    }

    .like-button img {
        width: 16px !important;
        height: 16px !important;
        vertical-align: middle;
    }


    .custom-tooltip {
        position: fixed;
        top: 10%; /* Adjust as needed */
        left: 50%; /* Adjust to position tooltip as required */
        transform: translateX(-50%);
        background-color: var(--text-color2); /* Use your custom background color */
        color: var(--text-color); /* Use your custom text color */
        padding: 20px; /* Custom padding */
        border-radius: 6px; /* Rounded corners */
        white-space: normal; /* Allow text to wrap */
        max-width: 70vw; /* Control maximum width */
        width: max-content;
        border: 2px solid var(--text-color); /* Custom border */
        font-family: 'Space Grotesk', sans-serif;
        font-size: 14px;
        font-weight: normal;
        line-height: 1.5;
        z-index: 100;
        opacity: 0;
        transition: opacity 0.3s;
        display: none;
    }
    

    .gallery-item.liked .like-button {
        display: none;
    }

    .side-panel {
        -webkit-backdrop-filter: blur(50px);
        backdrop-filter: blur(50px);
        
    }

 


    .side-panel {
        right: -100%;
        width: 100%; /* Ensure full width on mobile */
    }

    .side-panel.active {
        right: 0;
    }

    /* Optional: Prevent the page from zooming or shifting */
    .gallery {
        margin-right: 0 !important; /* Prevent margin change */
    }
    
   

    .gallery {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 32px;
        flex-grow: 1;
    }

    .gallery img {
        max-width: 80px;
        max-height: 80px;
        width: auto;
        height: 80px;
        object-fit: contain;
        image-rendering: pixelated;
        transition: transform 0.1s ease-in;
        display: block;
        margin: auto;
        
    }

    

    .side-panel {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        position: fixed;
        top: 0 !important;
        right: -100%;
        max-width: 100%;
        width: 100%;
        height: 100dvh;
        transition: right 0.2s ease-out;
        z-index: 11000;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;

    }

    .side-panel.closing {
        transition: right 0.3s ease-out !important;
    }

    .side-panel.closing *:not(.side-panel) {
        opacity: 0;
        transition: opacity 0.1s ease-out; /* Ensure this matches the panel's closing transition duration */
    }

    @keyframes image-swipe-down {
        0% {
            transform: translateY(100%) scale(0);
            opacity: 0; /* ADD THIS: Start invisible */
        }
        100% {
            transform: translateY(0) scale(1);
            opacity: 1; /* ADD THIS: End fully visible */
        }
    }
    
    @keyframes image-swipe-up {
        0% {
            transform: translateY(-100%) scale(0);
            opacity: 0; /* ADD THIS: Start invisible */
        }
        100% {
            transform: translateY(0) scale(1);
            opacity: 1; /* ADD THIS: End fully visible */
        }
    }
    
    .side-panel img.swipe-up {
        animation: image-swipe-up 0.5s ease-in-out forwards;
    }
    
    .side-panel img.swipe-down {
        animation: image-swipe-down 0.5s ease-in-out forwards;
    }


    
    
}


@media (min-width: 1800px) {

    main {
        padding: 64px !important;
    }

  

    .gallery {
        touch-action: manipulation;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); /* Auto-fit adjusts based on space */
        gap: 96px;
        flex-grow: 1;
        margin-top: 50px;
        transition: margin 0.3s ease; /* Smooth adjustment when the panel opens */
    }

    .gallery img {
       
        max-width: 256px;
        max-height: 256px;
        height: 256px;
    }

    
    
    

    .side-panel {
        right: -25%;
        width: 25%; /* Ensure full width on mobile */
        max-width: 25%;

    }

    .side-panel.active {
        right: 0;
    }



   

    

   
}