/* * { outline: 1px solid red; } */

/* .gallery-page-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
} */

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* THE GRID: Exact mirror of your collection-grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 140px));
    gap: 12px;
    padding: 5%;
    max-width: 1200px;
    margin: 0 auto;    /* Centers the whole grid on the page */
}

/* THE CARD: Exact mirror of your hashling-card */
.gallery-card {
    box-sizing: border-box;
    
    position: relative;
    width: 100%;
    height: auto;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    
    /* Animation for batch loading */
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.gallery-card:hover {
    transform: translateY(-5px);
    border-color: #555;
}

.gallery-card img {
    /* 3. Fit the whole sprite */
    width: 100%;
    height: 60%; /* Leaves a little room for the name */
    object-fit: contain; /* Forces the whole image to show, no cropping */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 6px currentColor); 
    margin-bottom: 8px;
}

.gallery-name {
    font-family: 'Pixelify Sans', sans-serif;
    color: white;
    font-size: 0.6rem;
    /* margin: 5px 0 0 0; */
    text-align: center;
}

.gallery-owner {
    font-size: 0.5rem;
    color: #888;
    text-transform: uppercase;
}

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

.load-more-btn {
    display: block;
    margin: 40px auto;
    padding: 10px 25px;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    cursor: pointer;
    font-family: 'Pixelify Sans', sans-serif;
}

.inspect-visuals {
    position: relative;
    width: 60%;
    height: 50%;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* overflow: hidden; */
}

.spinning-circle {
    position: absolute;
    height: 490%;
    opacity: 0.4;
    animation: rotate 40s linear infinite;
    filter: brightness(1.5);
    aspect-ratio: 1 / 1;
    pointer-events: none;
    filter: drop-shadow(0 0 20px currentColor);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-sprite {
    position: relative;
    width: 40%;
    z-index: 2;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    
    /* This adds the glow back using the browser's GPU (very fast) */
    filter: drop-shadow(0 0 6px currentColor);
    aspect-ratio: 1 / 1;
}

/* Ensure the modal is centered and on top */
#inspect-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9); /* Darken the background */
    display: flex; /* This makes it a flex container when NOT hidden */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Put it on top of everything */
    overflow: hidden;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #222;
    color: #fff;
    border: 2px solid #444;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.5rem;
    font-family: 'Pixelify Sans', sans-serif;
    transition: all 0.2s;
    z-index: 1010; /* Ensure it's above everything else */
}

.close-btn:hover {
    background: #721c24; /* Subtle red for "close" */
    border-color: #f5c6cb;
    transform: scale(1.1);
}

.inspect-info h2 {
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stats-placeholder {
    background: #151515;
    padding: 15px;
    border-radius: 10px;
    border: 1px inset #222;
    margin-bottom: 20px;
}

.inspect-actions {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two buttons per row */
    gap: 10px;
}

.delete-btn {
    grid-column: span 2; /* Make delete span the full width */
    margin-top: 5px;
    background: #441111;
}

.stats-container p {
    font-family: 'Pixelify Sans', sans-serif;
    color: #aaa;
    font-size: 0.85rem;
    margin: 8px 0;
    text-transform: uppercase;
}

.stats-container span {
    color: #fff; /* Make the actual values brighter than the labels */
}

.hash-display {
    display: block;
    font-size: 0.7rem;
    color: #00ffcc !important; /* Give the "DNA" a special color */
    word-break: break-all; /* Ensures the long hash doesn't bleed out of the box */
    margin-top: 4px;
    opacity: 0.8;
}

.inspect-content {
    background: #0a0a0a;
    border: 3px solid #333;
    padding: 40px 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    display: flex;
    flex-direction: column; /* Stacks vertically by default */
    gap: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}