/* The container that holds all the cards */
.hashling-grid {
    display: grid;
    /* This creates as many columns as will fit, each at least 250px wide */
    grid-template-columns: repeat(auto-fill, minmax(40px, 140px));
    gap: 12px; /* Space between cards */
    padding: 5%;
    max-width: 1200px; /* Keeps the grid from getting too wide on massive monitors */
    margin: 0 auto;    /* Centers the whole grid on the page */
}

/* Individual Card Styling */
.hashling-card {
    position: relative;
    width: 100%;
    height: auto;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 12px; /* Smooth corners for that premium feel */
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 1 / 1; /* Keeps them perfect squares */
    overflow: hidden;
    cursor: pointer;

    /* Animation for batch loading */
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

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

/* Hover effect to make the collection feel interactive */
.hashling-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: #555;
}

/* Make sure images don't overflow the cards */
.hashling-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;
}

.hashling-name {
    font-family: 'Pixelify Sans', sans-serif;
    color: white;
    font-size: 0.6rem; /* Slightly smaller to fit the smaller box */
    margin: 0;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adds "..." if the name is too long */
}

/* Hide the action buttons until hover to keep it clean */
.card-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    gap: 10px;
}

/* .hashling-card:hover .card-actions {
    opacity: 1;
} */

#activateBtn {
    display: flex;
    width: 100%;
}

.icon-btn {
    background: #222;
    border: 1px solid #444;
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.icon-btn.delete:hover {
    background: #721c24;
    border-color: #f5c6cb;
}

.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);
}

.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 4px currentColor);
    aspect-ratio: 1 / 1;
}

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

.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;
}

.hidden {
    display: none !important;
}

/* 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;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
    position: absolute;
    top: 0px;
    left: 15px;
}

/* Ensure no hover effects from other CSS rules apply */
.star-btn:hover, .star-btn:focus, .star-btn:active {
    background: none !important;
    border: none !important;
    outline: none !important;
    transform: scale(1.2) rotate(-10deg); /* Adds a little "pop" */
}

#star-icon {
    fill: none;           /* Hollow center */
    stroke: white;        /* White outline */
    stroke-width: 2;
    transition: all 0.3s ease;
}

/* When the hashling is favorited, fill the star with white */
.star-btn.is-favorite #star-icon {
    fill: white;
}

.card-star-badge {
    position: absolute;
    top: 9px;
    left: 9px;

    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}