@font-face {
    font-family: 'Manrope';
    src: url('../fonts/Manrope-SemiBold.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Manrope Light';
    src: url('../fonts/Manrope-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Manrope Regular';
    src: url('../fonts/Manrope-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

body {
    font-family: 'Manrope', sans-serif;
    margin: 0;
    background-color: #1c1c1c;
    color: #f0f0f0;
    overflow-x: hidden;
}


body::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}


.hidden {
    display: none !important;
}

header.site-header {
    width: 100%;
    background: #2c2c2c;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px 0 32px;
    min-height: 80px;
    position: relative;
    z-index: 1100;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1004;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.vicioware-icon-link {
    position: static;
    top: unset;
    left: unset;
    z-index: auto;
    display: block;
}





.searchbar-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0;
    z-index: 1003;
    pointer-events: none;
}

#searchBar {
    padding: 10px 22px;
    border-radius: 20px;
    border: 1px solid #555;
    background-color: #2a2a2a;
    color: #f0f0f0;
    font-size: 1em;
    width: 400px;
    max-width: 90vw;
    font-family: 'Manrope Light', 'Manrope', sans-serif;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    transition: border-color 0.2s, box-shadow 0.2s;
    margin: 0;
    display: block;
    pointer-events: auto;
}

#searchBar:focus {
    border-color: #5ac560;
    box-shadow: 0 0 0 2px #5ac56033;
}

#searchBar::placeholder {
    font-family: 'Manrope Light', 'Manrope', sans-serif;
    font-weight: 300;
    color: #bdbdbd;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 15px 10px 10px 10px;
    gap: 10px;
}

.game-item {
    position: relative;
    background: linear-gradient(to bottom, #1a1a1a, #111111 40%, #0a0a0a);
    border-radius: 8px;
    text-align: center;
    width: 120px;
    overflow: visible;
    text-decoration: none;
    transition: transform 0.2s ease-in-out;
    z-index: 1;
}



.game-item {
    position: relative;
    background: linear-gradient(to bottom, #1a1a1a, #111111 40%, #0a0a0a);
    border-radius: 8px;
    text-align: center;
    width: 120px;
    overflow: visible;
    text-decoration: none;
    transition: transform 0.2s ease-in-out, box-shadow 0.25s ease-out;
    z-index: 1;
}

.game-item::after {
    display: none;
}

.game-item::before {
    display: none;
}

.game-item:hover {
    transform: scale(1.05);
}

.game-item img {
    width: 100%;
    height: auto;
    display: block;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    background-color: #2a2a2a;
    min-height: 160px;
    object-fit: cover;
    will-change: opacity;
    content-visibility: auto;
    contain: layout style paint;
}

.game-item p {
    margin: 10px 0;
    font-size: 0.9em;
    color: #fff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
    padding: 0 5px;
}

.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 1200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.19, 1, 0.22, 1), visibility 0s linear 0.25s;
    backdrop-filter: blur(5px);
    will-change: opacity, visibility;
}

.modal.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}


.modal.is-open .modal-content,
#detailsModal.is-open .details-modal-content,
#partsModal.is-open .parts-modal-content {
    will-change: auto;
}

.modal-content {
    background: linear-gradient(145deg, #232323, #1a1a1a);
    padding: 30px 30px 22px 30px;
    border: none;
    width: 90%;
    max-width: 550px;
    border-radius: 10px;
    position: relative;
    color: #f0f0f0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translate3d(0, -40px, 0) scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    font-weight: normal;
    line-height: 1;
    background: rgba(255, 255, 255, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.modal.is-open .modal-content {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
}

#modalGameTitle {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 15px;
    font-size: 2em;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    padding-bottom: 15px;
}

#modalGameTitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #5ac560, #4a9c4a);
    border-radius: 3px;
}

#modalDownloadLinks {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    margin-bottom: 0;
}


#modalDownloadLinks li {
    margin-bottom: 7px;
    position: relative;
    transition: margin-bottom 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#modalDownloadLinks a {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5ac560, #4a9c4a);
    color: white;
    padding: 16px 24px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    font-family: 'Manrope Regular', 'Manrope', sans-serif;
}

#modalDownloadLinks a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.4s;
}

#modalDownloadLinks a:hover {
    background: linear-gradient(135deg, #4a9c4a, #5ac560);
    transform: translateY(-3px);
}

#modalDownloadLinks a:hover::before {
    left: 100%;
}

#modalDownloadLinks a:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(90, 197, 96, 0.3);
}

.read-more-container {
    margin-top: 15px;
    margin-bottom: 4px;
    position: relative;
}

.read-more-toggle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    font-weight: 500;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.read-more-toggle::before {
    display: inline-block;
    margin-right: 6px;
    font-size: 1.1em;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.read-more-toggle.active::before {
    content: '−';
    transform: rotate(180deg);
}

.read-more-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.read-more-toggle:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}




.modal-buttons-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 15px;
    margin-bottom: 4px;
    gap: 10px;
    width: 100%;
    position: relative;
    flex-wrap: wrap;
}





#detailsModal {
    display: none;
    position: fixed;
    z-index: 1300;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#detailsModal.is-open {
    display: flex;
    opacity: 1;
}

.details-modal-content {
    background: linear-gradient(145deg, #232323, #1a1a1a);
    padding: 15px;
    border: none;
    width: 90%;
    min-width: 200px;
    max-width: 400px;
    max-height: 80vh;
    border-radius: 14px;
    position: relative;
    color: #f0f0f0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s ease;
    will-change: transform, opacity;
    overflow-y: auto;
    text-align: left;
    box-sizing: border-box;
}

#detailsModal.is-open .details-modal-content {
    transform: scale(1);
    opacity: 1;
}

.details-content {
    font-size: 0.95em;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-line;
    padding: 15px;
    max-height: 60vh;
    margin-bottom: 10px;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
}

.details-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.3s ease;
}

.details-close-button:hover {
    color: rgba(255, 255, 255, 0.8);
}


#partsModal {
    display: flex;
    align-items: center;
    justify-content: center;
}

.parts-modal-content {
    background: linear-gradient(145deg, #232323, #1a1a1a);
    padding: 20px;
    border: none;
    width: 90%;
    min-width: 300px;
    max-width: 500px;
    height: auto;
    border-radius: 14px;
    position: relative;
    color: #f0f0f0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translate3d(0, -40px, 0) scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s ease;
    will-change: transform, opacity;
    overflow-y: auto;
    text-align: center;
    box-sizing: border-box;
}

#partsModal.is-open .parts-modal-content {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
}

.parts-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.3s ease;
}

.parts-close-button:hover {
    color: rgba(255, 255, 255, 0.8);
}

#partsModalTitle {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: #f0f0f0;
    text-align: center;
}

.parts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 10px 0;
}

.part-button {
    background: #4a4a4a;
    color: #f0f0f0;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-family: 'Manrope', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.part-button:hover {
    background: #5a5a5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.part-button.downloaded {
    background: #5ac560;
    color: white;
}

.part-button.downloaded:hover {
    background: #4fb556;
}


.download-with-parts {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5ac560, #4a9c4a) !important;
    color: white !important;
    padding: 16px 24px !important;
    text-decoration: none;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
    text-align: center;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    border: none !important;
    font-family: 'Manrope Regular', 'Manrope', sans-serif;
    cursor: pointer;
    width: 100% !important;
    margin-bottom: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    padding-right: 50px !important;
}

.download-with-parts::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s;
}

.download-with-parts:hover {
    background: linear-gradient(135deg, #4a9c4a, #5ac560) !important;
    transform: translateY(-3px) !important;
}

.download-with-parts:hover::before {
    left: 100%;
}

.download-with-parts:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 10px rgba(90, 197, 96, 0.3) !important;
}

.download-with-parts::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url('../resources/parts.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.9;

    will-change: transform;
}

body.modal-blur-active>*:not(#downloadModal):not(#detailsModal):not(#partsModal) {
    filter: blur(5px);
    transition: filter 0.3s ease-in-out;
}

.gallery-container {
    transition: filter 0.3s ease-in-out;
}



.vicioware-icon-link {
    position: static;
    top: unset;
    left: unset;
    z-index: auto;
    display: block;
}

.vicioware-icon-link img {
    width: 48px;
    height: 48px;
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.vicioware-icon-link:hover img {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}


@media (max-width: 768px) {
    header.site-header {
        flex-direction: column;
        padding: 16px;
        min-height: auto;
    }

    .header-left,
    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .header-center {
        width: 100%;
        order: 2;
        padding: 16px 0 0 0;
    }

    .header-left {
        order: 1;
    }

    .header-right {
        order: 1;
        flex-grow: 1;
        justify-content: flex-end;
    }



    #searchBar {
        width: 100%;
    }

    .game-item {
        width: calc(50% - 10px);
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .details-modal-content {
        width: 85%;
        min-width: 250px;
        max-width: 320px;
        max-height: 75vh;
        padding: 12px 15px;
    }

    .details-content {
        font-size: 0.9em;
        max-height: 50vh;
        padding: 0;
        margin-bottom: 5px;
        text-align: center;
    }
}

/* Alphabet Filter */
.alphabet-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 20px;
    margin: 0 auto 10px auto;
    max-width: 900px;
    z-index: 1002;
    position: relative;
}

.alphabet-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdbdbd;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    min-width: 36px;
    text-align: center;
}

.alphabet-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.alphabet-btn.active {
    background: #5ac560;
    color: #fff;
    border-color: #5ac560;
    box-shadow: 0 2px 8px rgba(90, 197, 96, 0.4);
    font-weight: 700;
}

@media (max-width: 768px) {
    .alphabet-filter {
        gap: 6px;
        padding: 10px;
        overflow-x: auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .alphabet-filter::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari */
    }

    .alphabet-btn {
        padding: 6px 10px;
        font-size: 0.85em;
        flex-shrink: 0;
    }
}



.filter-toggle-btn {
    background: linear-gradient(135deg, #2c2c2c, #222);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-toggle-btn:hover,
.filter-toggle-btn.active {
    background: #333;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.filter-toggle-btn svg {
    opacity: 0.8;
}

.filter-menu {
    position: absolute;
    top: 100%;
    right: 20px;
    margin-top: 8px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    min-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 1005;
}

.filter-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-section {
    margin-bottom: 16px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h4 {
    margin: 0 0 10px 0;
    font-size: 0.85em;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
    font-weight: 600;
}

.sort-buttons {
    display: flex;
    gap: 8px;
}

.sort-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sort-btn.active {
    background: #5ac560;
    color: #fff;
    border-color: #5ac560;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.filter-menu .alphabet-btn {
    padding: 6px 0;
    font-size: 0.9em;
    width: 100%;
}

@media (max-width: 768px) {
    .filter-wrapper {
        justify-content: center;
    }

    .filter-menu {
        right: 50%;
        transform: translateX(50%) translateY(-10px);
        width: 90%;
        max-width: 320px;
    }

    .filter-menu.is-open {
        transform: translateX(50%) translateY(0);
    }
}



.filter-group {
    position: relative;
}

/* Adjust filter menu position for splitting */
.filter-menu {
    right: 0;
    min-width: 240px;
}

.sort-menu {
    min-width: 260px;
}

.sort-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sort-option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 0.95em;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(2px);
}

.sort-option-btn.active {
    background: #5ac560;
    color: #fff;
    border-color: #5ac560;
    font-weight: 600;
}

/* Add checkmark for active sort */
.sort-option-btn.active::after {
    content: '✓';
    font-weight: bold;
}

@media (max-width: 768px) {
    .filter-wrapper {
        justify-content: center;
    }

    .filter-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }

    .filter-menu.is-open {
        transform: translateX(-50%) translateY(0);
    }
}.filter-wrapper {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 15px 40px;
    /* Aligned with typical side padding */
    margin: 0;
    max-width: 100%;
}

.filter-group {
    position: relative;
}

/* Ensure menu positioning is correct relative to the button */
.filter-menu {
    right: 0;
    margin-top: 5px;
}
