* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: 
        linear-gradient(to bottom, rgba(6, 11, 17, 0) 0%, rgba(6, 11, 17, 0.7) 40%, rgba(6, 11, 17, 1) 70%),
        url("/assets/bgtop.webp") no-repeat center top / cover fixed;
    background-color: #060b11;
    color: white;
    font-family: "Poppins", sans-serif;
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.announcement-bar {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 100;
    padding: 8px 0;
    text-align: center;
}

.announcement-content {
    display: inline-block;
}

.announcement-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.announcement-text strong {
    text-transform: uppercase;
    font-weight: 700;
}

.main-container {
    flex: 1;
    min-height: 100vh;
    position: relative;
    transition: all 0.3s ease;
}

.header {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2.5rem;
    gap: 1rem;
}

.logo {
    width: 10rem;
    height: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.logo:hover {
    transform: scale(1.05) rotate(2deg);
    filter: drop-shadow(0 8px 20px rgba(96, 165, 250, 0.4));
}

.github-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 1.0rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-btn.youtube {
    color: #FF0000;
}

.social-btn.discord {
    color: #5865F2;
}

.social-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.inventory-container {
    position: relative;
    z-index: 10;
    font-family: "Poppins", sans-serif;
    color: white;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    width: 66.666667%;
    padding-top: 2.5rem;
    transition: width 0.3s ease;
}

.inventory-content {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 100%;
    gap: 1rem;
}

.controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    position: relative;
    z-index: 100;
    gap: 1rem;
}

.category-dropdown-wrapper {
    position: relative;
    width: 280px;
    z-index: 100;
}

.category-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-radius: 2px;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.category-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.category-dropdown-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.category-dropdown-arrow svg {
    width: 18px;
    height: 18px;
    color: #60a5fa;
    transition: all 0.3s ease;
}

.category-dropdown-wrapper.open .category-dropdown-arrow {
    transform: rotate(180deg);
}

.category-dropdown-wrapper.open .category-dropdown-arrow svg {
    color: #4ade80;
}

.category-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transition: max-height 0.35s ease, opacity 0.25s ease;
    z-index: 9999;
    opacity: 0;
}

.category-dropdown-wrapper.open .category-dropdown-menu {
    max-height: 380px;
    overflow-y: auto;
    opacity: 1;
}

.category-dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.category-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.category-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 3px;
}

.category-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

.category-option {
    padding: 0.7rem 1.1rem;
    color: rgba(255, 255, 255, 1.0);
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.category-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-left-color: #fefefe;
    padding-left: 1.4rem;
}

.category-option.active {
    background: rgba(74, 222, 128, 0.08);
    color: #ffffff;
    border-left-color: #4ade80;
    font-weight: 600;
}

.total-counter {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
}

.total-counter .count {
    color: #4ade80;
    font-weight: 700;
    font-size: 1.1em;
}

.search-container {
    display: flex;
    width: 3rem;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
    justify-content: center;
    gap: 0.15rem;
    align-items: center;
    padding: 0.75rem 1rem;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container.expanded {
    width: 12rem;
}

.search-icon {
    display: flex;
    align-items: center;
    margin-left: 0rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.search-icon:hover {
    transform: scale(1.1);
}

.search-input {
    width: 0;
    opacity: 0;
    text-align: center;
    font-weight: 600;
    background-color: transparent;
    outline: none;
    border: none;
    color: white;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    pointer-events: none;
}

.search-container.expanded .search-input {
    width: 75%;
    opacity: 1;
    pointer-events: auto;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.items-grid {
    background: rgba(0, 0, 0, 0.2);
    width: 100%;
    height: auto;
    border-radius: 2px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 140px);
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem;
    backdrop-filter: blur(20px);
    min-height: 200px;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 140px;
    height: 140px;
    overflow: hidden;
}

.item:hover {
    background: linear-gradient(135deg, rgba(83, 94, 110, 0.8), rgba(35, 38, 44, 0.8));
}

.item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.4rem;
    max-width: 100%;
    flex-shrink: 0;
    opacity: 0;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.item:hover img {
    transform: scale(1.2);
}

.item img.loaded {
    opacity: 1;
}

.item img.lazy {
    opacity: 1;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.item.skeleton {
    pointer-events: none;
}

.item.skeleton .item-name {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    color: transparent;
    min-height: 1rem;
}

.item-name {
    font-size: 0.65rem;
    text-align: center;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-transform: capitalize;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    line-height: 1.2;
    transition: color 0.3s ease;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    flex-direction: column;
    gap: 1.5rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #4ade80;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.header {
    animation: fadeIn 0.6s ease-out;
}

.controls {
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.items-grid {
    animation: fadeIn 1s ease-out 0.3s both;
}

.no-results {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    flex-direction: column;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.4));
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-items {
    margin-bottom: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 2px;
}

.selected-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
}

.selected-info>span {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.selected-items .count {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1em;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #4ade80;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    color: #22c55e;
}

.download-btn svg {
    flex-shrink: 0;
}

.item.selected {
    border-color: #4ade80;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(34, 197, 94, 0.25));
}

.item {
    position: relative;
}

@media (max-width: 1599px) and (min-width: 1280px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, 140px);
    }
}

@media (max-width: 1279px) and (min-width: 1024px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, 140px);
    }

    .inventory-container {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, 140px);
    }

    .controls {
        flex-direction: column;
        gap: 1rem;
    }

    .category-dropdown-wrapper {
        width: 100%;
    }

    .total-counter {
        position: static;
        transform: none;
    }

    .inventory-container {
        width: 95%;
    }
}

@media (max-width: 640px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, 140px);
        padding: 1rem;
    }

    .controls {
        flex-direction: column;
        gap: 1rem;
    }

    .category-dropdown-wrapper {
        width: 100%;
    }

    .total-counter {
        position: static;
        transform: none;
    }

    .search-container {
        position: relative;
        left: auto;
    }

    .header {
        padding-top: 1.5rem;
    }

    .logo {
        width: 8rem;
    }

    .selected-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .download-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, 100px);
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .item img {
        width: 40px;
        height: 40px;
    }

    .item-name {
        font-size: 0.6rem;
    }

    .category-dropdown-btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }
}