:root {
    --red: #a71919;
    --dark-red: #651010;
    --gold: #f0b536;
    --cream: #f8e7c0;
    --wood: #3b2114;
    --dark: #120c09;
    --card: rgba(42, 24, 16, 0.94);
    --muted: #cdbd9d;
    --border: rgba(240, 181, 54, 0.25);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--cream);
    background:
        linear-gradient(rgba(18, 12, 9, 0.76), rgba(18, 12, 9, 0.94)),
        url("assets/images/bg.png") center / cover fixed,
        #1b100b;
}

a {
    color: inherit;
}

.page-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(90deg, transparent 0 58px, rgba(255,255,255,.018) 59px 60px),
        repeating-linear-gradient(0deg, transparent 0 58px, rgba(255,255,255,.018) 59px 60px);
    z-index: -1;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 16px clamp(20px, 5vw, 76px);
    background: rgba(20, 11, 8, 0.94);
    border-bottom: 2px solid var(--gold);
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1;
}

.brand-small {
    color: var(--gold);
    font-weight: 900;
    letter-spacing: 2px;
    font-size: .75rem;
}

.brand-large {
    color: white;
    font-size: clamp(1rem, 2vw, 1.45rem);
    font-weight: 900;
    margin-top: 5px;
}

.nav-links {
    display: flex;
    gap: 12px;
}

.nav-links a {
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--red);
    color: white;
}

main {
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: 60px;
}

.hero {
    padding: clamp(52px, 8vw, 100px) 0 48px;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 7px 12px;
    margin-bottom: 16px;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: rgba(101, 16, 16, .82);
    color: var(--gold);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: 1.8px;
}

.hero h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem, 7vw, 5.8rem);
    line-height: .95;
    color: white;
    text-shadow: 0 5px 0 #5a130f, 0 10px 24px rgba(0,0,0,.55);
}

.hero p {
    width: min(700px, 100%);
    margin: 22px auto 0;
    color: #ead9bc;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.primary-button,
.secondary-button,
.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 900;
    border-radius: 7px;
    transition: transform .15s ease, filter .15s ease, background .15s ease;
}

.primary-button,
.secondary-button {
    min-height: 48px;
    padding: 0 20px;
}

.primary-button {
    background: linear-gradient(#ca3029, #851511);
    border: 1px solid #e95048;
    color: white;
    box-shadow: 0 8px 22px rgba(80, 0, 0, .35);
}

.secondary-button {
    border: 1px solid var(--gold);
    color: var(--gold);
    background: rgba(34, 20, 13, .8);
}

.primary-button:hover,
.secondary-button:hover,
.download-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 28px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(28, 16, 11, .9);
}

.search-box,
.select-box {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--gold);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .8px;
    text-transform: uppercase;
}

input,
select {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid #795131;
    border-radius: 6px;
    background: #170f0c;
    color: white;
    font: inherit;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(240, 181, 54, .13);
}

.mod-count {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 6px;
    background: var(--dark-red);
    white-space: nowrap;
}

.mod-count strong {
    font-size: 1.35rem;
    color: white;
}

.mod-count span {
    color: #f2c3bb;
}

.status-message {
    padding: 34px;
    text-align: center;
    color: var(--muted);
}

.mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 22px;
}

.mod-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    box-shadow: 0 16px 40px rgba(0,0,0,.24);
    transition: transform .18s ease, border-color .18s ease;
}

.mod-card:hover {
    transform: translateY(-4px);
    border-color: rgba(240, 181, 54, .7);
}

.mod-thumbnail-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #160f0c;
    overflow: hidden;
}

.mod-thumbnail {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.mod-category {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 6px 9px;
    border-radius: 5px;
    background: rgba(101, 16, 16, .95);
    color: var(--gold);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.mod-details {
    padding: 18px;
}

.mod-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mod-name {
    margin: 0;
    color: white;
    font-size: 1.25rem;
}

.mod-version {
    flex: 0 0 auto;
    padding: 5px 7px;
    border-radius: 4px;
    background: #2a1c14;
    color: var(--gold);
    font-size: .72rem;
    font-weight: 800;
}

.mod-description {
    min-height: 52px;
    margin: 13px 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: .92rem;
}

.mod-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
    color: #ae9b80;
    font-size: .79rem;
}

.mod-author::before {
    content: "By ";
    color: #806f5c;
}

.mod-loader::before {
    content: "Loader: ";
    color: #806f5c;
}

.download-button {
    width: 100%;
    min-height: 44px;
    justify-content: space-between;
    padding: 0 15px;
    background: linear-gradient(#bc2a24, #7c130f);
    border: 1px solid #d63c34;
    color: white;
}

footer {
    padding: 28px 20px;
    text-align: center;
    border-top: 1px solid rgba(240, 181, 54, .18);
    background: rgba(12, 8, 6, .92);
    color: #9f8d73;
    font-size: .85rem;
}

@media (max-width: 760px) {
    .site-header {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .nav-links a {
        text-align: center;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .mod-grid {
        grid-template-columns: 1fr;
    }
}
.mod-actions {
    position: relative;
    margin-top: auto;
    padding-top: 1.6rem;
}

/*
 * Main local JAR download button.
 */
.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 2px solid #d69a2d;
    border-radius: 6px;
    color: #ffffff;
    background: linear-gradient(
        180deg,
        #b32424 0%,
        #7f1111 100%
    );
    box-shadow: 0 4px 0 #4e0909;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition:
        transform 0.15s ease,
        filter 0.15s ease,
        opacity 0.15s ease;
}

.download-button:hover:not(.is-disabled) {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.download-button:active:not(.is-disabled) {
    transform: translateY(0);
}

/*
 * Small Modrinth icon positioned just above the
 * upper-left corner of the download button.
 */
.modrinth-button {
    position: absolute;
    left: 0;
    bottom: calc(100% - 1.35rem);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 5px;
    border: 2px solid #8ed56f;
    border-radius: 7px;
    background: #161a18;
    box-shadow: 0 3px 0 #24511d;
    text-decoration: none;
    transition:
        transform 0.15s ease,
        filter 0.15s ease;
    z-index: 2;
}

.modrinth-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modrinth-button:hover:not(.is-disabled) {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.modrinth-button:active:not(.is-disabled) {
    transform: translateY(0);
}

.download-button.is-disabled,
.modrinth-button.is-disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

.download-button.is-checking {
    opacity: 0.7;
    pointer-events: none;
}

.download-button:focus-visible,
.modrinth-button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}
