* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 275px;
}

body {
    margin: 0;
    padding: 0 30px 30px;
    font-family: Arial, sans-serif;
    background: #111;
    color: #eee;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 25px;
    padding: 30px 16px 16px;
    background: #111;
}

.title-box {
    background: #1b1b1b;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.title-box h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.title-box p {
    margin: 0;
    color: #999;
}

.abbreviation-box {
    margin-top: 10px;
    padding: 12px 16px;
    background: #1b1b1b;
    border: 1px solid #333;
    border-radius: 10px;
}

.abbreviation-title {
    margin-bottom: 8px;
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
}

.abbreviations {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 20px;
    font-size: 12px;
    color: #aaa;
}

.abbreviations span {
    white-space: nowrap;
}

.section-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.section-nav button {
    padding: 8px 18px;
    background: #1b1b1b;
    border: 1px solid #333;
    border-radius: 7px;
    color: #eee;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition:
            background 0.15s ease,
            border-color 0.15s ease;
}

.section-nav button:hover {
    background: #242424;
    border-color: #555;
}

.results-summary {
    margin-bottom: 25px;
    padding: 12px 16px;
    background: #1b1b1b;
    border: 1px solid #333;
    border-radius: 8px;
    color: #aaa;
    font-size: 13px;
}

.results-summary strong {
    color: #eee;
    font-size: 15px;
}

.gearset-section {
    margin-bottom: 35px;
}

.gearset-section-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.gearset-section-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.gearset-section-header p {
    margin: 0;
    color: #888;
    font-size: 12px;
}

#brand-set-grid,
#gear-set-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.gearset {
    background: #1b1b1b;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 16px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.gearset-header {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2d2d2d;
}

.gearset-header h2 {
    margin: 0 0 5px;
    font-size: 21px;
}

.gearset-id {
    color: #aaa;
    font-size: 12px;
}

.uid {
    margin-top: 3px;
    font-family: monospace;
    font-size: 10px;
    color: #666;
    word-break: break-all;
}

.bonuses {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.bonus {
    background: #141414;
    border: 1px solid #2d2d2d;
    border-radius: 7px;
    padding: 12px;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bonus > h3 {
    margin: 0 0 9px;
    font-size: 14px;
    text-align: center;
}

.modes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    flex: 1;
}

.mode {
    background: #1c1c1c;
    border-radius: 5px;
    padding: 9px;
    min-width: 0;
}

.mode h3 {
    margin: 0 0 7px;
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
}

.attribute-list {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(0, 1fr)
    );
    gap: 8px;
    width: 100%;
}

.attribute-box {
    min-width: 0;
    padding: 8px;
    background: #151515;
    border: 1px solid #292929;
    border-radius: 5px;
    text-align: center;
}

.attribute-name {
    font-size: 14px;
    color: #eee;
    line-height: 1.35;
    overflow-wrap: break-word;
    word-break: normal;
}

.attribute-not-found {
    color: #eee;
    font-style: normal;
}

.attribute-value {
    margin-top: 3px;
    font-size: 20px;
    font-weight: bold;
}

.attribute-uid {
    display: none;
}

.no-attribute {
    margin: 0;
    font-size: 11px;
    color: #666;
}

.balance-difference {
    margin-top: 8px;
    padding: 8px;
    background: #1c1c1c;
    border-radius: 5px;
    text-align: center;
}

.balance-label {
    margin-bottom: 3px;
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
}

.balance-value {
    font-size: 16px;
    font-weight: bold;
}

.balance-positive {
    color: #5fd35f;
}

.balance-negative {
    color: #f05a5a;
}

.balance-neutral {
    color: #aaa;
}

.loading {
    padding: 20px;
    background: #1b1b1b;
    border: 1px solid #333;
    border-radius: 8px;
    color: #aaa;
}

.error {
    padding: 20px;
    background: #241414;
    border: 1px solid #633;
    border-radius: 8px;
    color: #f88;
}

#gear-set-grid .bonuses {
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
}

#brand-set-grid .attribute-list:has(
    .attribute-box:only-child
) {
    display: block;
}

#brand-set-grid .attribute-list:has(
    .attribute-box:only-child
) .attribute-box {
    border: 0;
    background: transparent;
    padding: 0;
}

#gear-set-grid .attribute-list {
    grid-template-columns: repeat(
        auto-fit,
        minmax(120px, 1fr)
    );
}

#gear-set-grid .mode {
    min-height: 125px;
}

@media (min-width: 1600px) {
    body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .container {
        max-width: 1900px;
    }

    #brand-set-grid,
    #gear-set-grid {
        grid-template-columns: repeat(
            3,
            minmax(0, 1fr)
        );
    }

    .attribute-box {
        padding: 10px;
    }

    #gear-set-grid .attribute-list {
        gap: 10px;
    }
}

@media (max-width: 1200px) {
    #brand-set-grid,
    #gear-set-grid {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}

@media (max-width: 800px) {
    body {
        padding: 15px;
    }

    .page-header {
        padding: 10px;
    }

    #brand-set-grid,
    #gear-set-grid {
        grid-template-columns: 1fr;
    }

    .bonuses {
        grid-template-columns: 1fr;
    }

    #gear-set-grid .bonuses {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }

    .modes {
        grid-template-columns: 1fr 1fr;
    }

    .attribute-list {
        grid-template-columns: repeat(
            auto-fit,
            minmax(110px, 1fr)
        );
    }

    .abbreviations {
        gap: 5px 12px;
    }

    .section-nav {
        justify-content: stretch;
    }

    .section-nav button {
        flex: 1;
    }
}

@media (max-width: 550px) {
    .title-box h1 {
        font-size: 23px;
    }

    .bonuses,
    #gear-set-grid .bonuses {
        grid-template-columns: 1fr;
    }

    .modes {
        grid-template-columns: 1fr;
    }

    .attribute-list {
        grid-template-columns: repeat(
            auto-fit,
            minmax(100px, 1fr)
        );
    }
}