.category {
    margin-bottom: 2em;
}
.items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}
.item-sprite {
    background: #222;
    margin-bottom: 4px;
}
.item-badge {
    position: absolute;
    left: 1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    z-index: 10;
    pointer-events: none;
}
.item-sprite {
    position: relative;
}
.item-name {
    font-size: 0.9em;
    text-align: center;
    word-break: break-word;
}
body {
    background: #222;
    color: #eee;
}
@font-face {
    font-family: 'ChronoType';
    src: url('https://cdn.shopify.com/s/files/1/1913/2391/files/ChronoType.otf?v=1658081288') format('opentype');
    font-display: swap;
}

body, .item-name, h1, h2, h3 {
    font-family: 'ChronoType', Consolas, 'Courier New', monospace;
    text-shadow:
        1px 1px 0 #000,
       -1px 1px 0 #000,
        1px -1px 0 #000,
       -1px -1px 0 #000,
        0px 2px 0 #000,
        2px 0px 0 #000,
        0px -2px 0 #000,
       -2px 0px 0 #000;
    letter-spacing: 0.5px;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: auto;
    font-smooth: never;
}
.item-tooltip {
    position: fixed;
    z-index: 1000;
    min-width: 180px;
    background: #232226;
    border: 2px solid #7c3aed;
    color: #fff;
    font-family: 'ChronoType', Consolas, 'Courier New', monospace;
    font-size: 1.1em;
    padding: 10px 16px 10px 10px;
    border-radius: 6px;
    pointer-events: none;
    box-shadow: 0 4px 24px #000a;
    text-shadow:
        1px 1px 0 #000,
       -1px 1px 0 #000,
        1px -1px 0 #000,
       -1px -1px 0 #000;
    opacity: 0.97;
}
.item-tooltip .item-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}
.item-sprite.shiny {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-block;
    overflow: hidden;

    /* Required for masking */
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.item-sprite.shiny::before {
    content: "";
    position: absolute;
    top: 0; left: -150%;
    width: 300%;
    height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 40%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 60%,
        rgba(255,255,255,0) 100%
    );
    animation: shine 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;

    /* Mask to item pixels */
    -webkit-mask-image: url(var(--sprite-url));
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url(var(--sprite-url));
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;

    mix-blend-mode: screen;
}

@keyframes shine {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}
.collection-log {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 220px;
    background: #1a1a1a;
    padding: 1em;
    overflow-y: auto;
    border-right: 2px solid #333;
}

@media (max-width: 700px) {
    .sidebar {
        width: 80px;
        min-width: 60px;
        max-width: 100px;
        font-size: 0.85em;
        padding-left: 2px;
        padding-right: 2px;
    }
    .sidebar button {
        font-size: 0.95em;
        padding: 6px 4px;
    }
}

.sidebar button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #2d2d2d;
    color: #eee;
    text-align: left;
    border: none;
    border-radius: 4px;
    font-family: 'ChronoType', Consolas, monospace;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar button:hover,
.sidebar button.active {
    background: #4b0082;
    color: #fff;
}

.sidebar-btn.complete {
    color: limegreen;
    font-weight: bold;
}

.main-content {
    flex: 1;
    padding: 1em;
    overflow-y: auto;
}

.items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* tighter spacing */
}
.item {
    width: 60px;
    text-align: center;
}
.item-sprite {
    width: 40px;
    height: 40px;
}
.item-sprite::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 2;
  display: none;
  pointer-events: none;
}

.item:not(.owned) .item-sprite::after {
  display: block;
}
/* Header styling */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #4b0082;
    z-index: 999;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #444;
}

.site-header.transparent {
    background: #4b0082;
    backdrop-filter: blur(6px);
}

.header-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.2em;
    margin: 0;
    color: #eee;
}

@media (max-width: 600px) {
    .site-title {
        display: none;
    }
    .header-content {
        justify-content: flex-start;
    }
}

.search-input {
    padding: 4px 8px;
    font-size: 0.9em;
    border-radius: 4px;
    border: 1px solid #666;
    background-color: #111;
    color: #eee;
    font-family: 'ChronoType', Consolas, monospace;
}

/* Adjust page layout to account for fixed header */
.collection-log {
    display: flex;
    margin-top: 48px;
}
.item-sprite-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
}

.item-label {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 3px;
    text-shadow: 1px 1px 0 #000;
}

.st-label {
    background-color: #ff9e00;
    color: #000;
}

.ut-label {
    background-color: #a259ff;
    color: #fff;
}
.sidebar {
    /* ...existing styles... */
    display: flex;
    flex-direction: column;
    align-items: center; /* This centers children horizontally */
}

.sidebar-search {
    width: 100%; /* or a fixed width like 200px */
    margin: 12px 0 16px 0;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #7c3aed;
    font-size: 1em;
    background: #18171c;
    color: #ffd700;
    outline: none;
    margin-bottom: 12px;
    box-sizing: border-box;
    display: block;
    font-family: 'ChronoType', Consolas, monospace;
}
.item-sprite-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
}

.item-qty {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: transparent;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px;
    pointer-events: none;
    font-family: 'ChronoType', Consolas, monospace;
    line-height: 1;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    padding: 4px 12px;
    background: #2d2d2d;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: 'ChronoType', Consolas, monospace;
    cursor: pointer;
    font-size: 0.95em;
    transition: background 0.2s;
}
.header-btn:hover {
    background: #464545;
    color: #fff;
}

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #232226;
    color: #fff;
    padding: 2em;
    border-radius: 8px;
    max-width: 400px;
    box-shadow: 0 4px 24px #000a;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}
.close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5em;
    color: #4b0082;
    cursor: pointer;
}
.faq-question {
    color: #ffd700;
}
.sidebar-category-header {
    background: #2d2d2d;
    color: #eee; /* match button color */
    font-weight: bold;
    width: 100%;
    border-radius: 4px;
    padding: 8px 12px;
    text-align: left;
    margin-bottom: 8px;
    border: none;
    font-family: 'ChronoType', Consolas, monospace;
    cursor: pointer;
    transition: background 0.2s;
}
.sidebar-category-header.sidebar-btn {
    color: #ffd700 !important;
}
.sidebar-category-header:hover {
    background: #4b0082;
    color: #fff;
}
.sidebar-category-section.open .sidebar-category-header {
    background: #4b0082;
    color: #fff;
}
.sidebar-category-section button.active {
    background: #7c3aed;
    color: #fff;
}
.player-autocomplete-dropdown div:hover {
    background: #4b0082;
    color: #fff;
}