/* =========================
   Villager Helper Page
========================= */

.villager-helper-page {
    width: min(100% - 32px, 1050px);
    margin: 0 auto;
    padding: 40px 0 60px;
}


/* =========================
   Profession Picker
========================= */

.profession-picker-section {
    width: min(100%, 560px);
    margin: 0 auto 32px;
}

.picker-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

#workstation {
    color: #e0c45c;
    font-weight: 600;
}

.villager-health .health {
    margin: 0;
    color: #f0808f;
    font-weight: 600;
}


/* =========================
   Searchable Select
========================= */

.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-input {
    width: 100%;
    box-sizing: border-box;

    padding: 13px 15px;

    color: #ffffff;
    background-color: #252525;

    border: 1px solid #4b4b4b;
    border-radius: 8px;

    font: inherit;

    outline: none;

    transition:
        border-color 0.2s ease,
        border-radius 0.1s ease;
}

.searchable-select-input:focus {
    border-color: #55b879;
}


/* Connect input to dropdown while open */

.searchable-select:has(.searchable-select-options:not(.hidden))
.searchable-select-input {
    border-color: #55b879;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}


/* =========================
   Search Options
========================= */

.searchable-select-options {
    position: absolute;
    z-index: 20;

    top: 100%;
    left: 0;

    width: 100%;
    max-height: 320px;

    box-sizing: border-box;

    overflow-y: auto;

    background-color: #252525;

    border: 1px solid #55b879;
    border-top: none;

    border-radius: 0 0 8px 8px;

    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);

    scrollbar-width: thin;
    scrollbar-color: #55b879 #202020;
}

.searchable-select-options::-webkit-scrollbar {
    width: 9px;
}

.searchable-select-options::-webkit-scrollbar-track {
    background-color: #202020;
    border-radius: 0 0 8px 0;
}

.searchable-select-options::-webkit-scrollbar-thumb {
    background-color: #438b5c;
    border: 2px solid #202020;
    border-radius: 10px;
}

.searchable-select-options::-webkit-scrollbar-thumb:hover {
    background-color: #68d489;
}

.search-option {
    padding: 11px 15px;

    color: #eeeeee;

    cursor: pointer;

    transition: background-color 0.15s ease;
}

.search-option:hover,
.search-option.selected {
    background-color: #334f3d;
}


/* =========================
   Villager Results
========================= */

.villager-results {
    overflow: hidden;

    background-color: #1d1d1d;

    border: 1px solid #3d674b;
    border-radius: 12px;

    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}


/* =========================
   Villager Profile
========================= */

.villager-profile {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 36px;

    padding: 36px;

    background-color: rgba(63, 143, 91, 0.16);
}

#villager-picture {
    width: 150px;
    height: 190px;

    object-fit: contain;

    image-rendering: auto;
}

.profile-info {
    min-width: 230px;
}

#villager-name {
    margin: 0 0 14px;

    font-size: 1.9rem;

    color: #6fdd91;
}

.profile-info p {
    margin: 8px 0;
    color: #d0d0d0;
}

.villager-health {
    display: flex;
    align-items: center;

    gap: 6px;
}

.villager-health .health {
    margin: 0;
}

.health-heart {
    width: 20px;
    height: 20px;

    object-fit: contain;

    image-rendering: pixelated;
}


/* =========================
   Enchanted Books Section
========================= */

.enchanted-books-section {
    padding: 32px 40px;

    text-align: center;

    border-top: 1px solid #353535;

    background-color: rgba(148, 73, 190, 0.12);
}

.enchanted-section-title {
    margin: 0 0 10px;

    font-size: 1.45rem;

    color: #d783ff;
}

.enchanted-section-description {
    max-width: 650px;

    margin: 0 auto 22px;

    color: #b9b9b9;

    line-height: 1.5;
}


/* =========================
   Enchanted Book Search
========================= */

.enchanted-books-section .searchable-select {
    width: min(100%, 620px);
    margin: 0 auto;
}

#enchanted-book-search-input {
    width: 100%;
}


/* =========================
   Selected Enchanted Book
========================= */

.enchanted-book-list {
    width: min(100%, 620px);

    margin: 20px auto 0;
}

.enchanted-book-option {
    padding: 18px;

    text-align: center;

    background-color: #252525;

    border: 1px solid #444444;
    border-radius: 8px;
}

.enchanted-book-name {
    margin: 0 0 14px;

    color: #eeeeee;

    font-size: 1.1rem;

    text-align: center;
}

.enchanted-book-levels {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 8px;
}


/* =========================
   Enchantment Level Buttons
========================= */

.enchanted-book-levels button {
    min-width: 40px;

    padding: 8px 11px;

    color: #d9f7e3;
    background-color: #304a38;

    border: 1px solid #477d58;
    border-radius: 6px;

    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.enchanted-book-levels button:hover {
    background-color: #3d6348;
    border-color: #62b27a;

    transform: translateY(-1px);
}

.enchanted-book-levels button:focus-visible {
    outline: 2px solid #6fdd91;
    outline-offset: 2px;
}


/* =========================
   Enchanted Book Detail View
========================= */

.back-button {
    display: flex;
    align-items: center;

    gap: 8px;

    margin: 0 0 24px;
    padding: 8px 12px;

    color: #b9b9b9;
    background: transparent;

    border: 1px solid #444444;
    border-radius: 6px;

    font: inherit;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.back-button:hover {
    color: #ffffff;

    background-color: #292929;

    border-color: #5d5d5d;
}

.back-button:focus-visible {
    outline: 2px solid #6fdd91;
    outline-offset: 2px;
}

.back-arrow {
    width: 22px;
    height: 22px;

    object-fit: contain;

    image-rendering: pixelated;

    transform: rotate(180deg);
}

.back-text {
    font-size: 0.9rem;
}

.book-title {
    margin: 0 0 26px;

    color: #6fdd91;

    font-size: 1.55rem;
    text-align: center;
    letter-spacing: 0.04em;
}


/* =========================
   Enchanted Book Trade
========================= */

.book-trade {
    width: min(100%, 650px);

    box-sizing: border-box;

    margin: 0 auto;
    padding: 26px;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 18px;

    background-color: #252525;

    border: 1px solid #444444;
    border-radius: 10px;
}

.book-trade-gives {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 10px;
}

.book-trade-item {
    display: flex;
    align-items: center;

    gap: 7px;
}

.name-of-item {
    color: #eeeeee;

    white-space: nowrap;
}

.book-trade .trade-symbol {
    color: #b7b7b7;

    font-size: 1rem;
}

.book-trade .trade-item-icon {
    width: 34px;
    height: 34px;

    object-fit: contain;

    image-rendering: pixelated;

    flex-shrink: 0;
}

.trade-arrow-down {
    width: 38px;
    height: 24px;

    object-fit: contain;

    image-rendering: pixelated;

    transform: rotate(90deg);
}

.book-trade-receives {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 12px 16px;

    color: #ffffff;

    background-color: rgba(111, 221, 145, 0.08);

    border: 1px solid rgba(111, 221, 145, 0.25);
    border-radius: 7px;

    font-weight: 600;
}


/* =========================
   Trade Progression
========================= */

.trade-progression {
    padding: 12px 40px 36px;

    border-top: 1px solid #353535;
}

.trade-tier {
    display: flex;
    flex-direction: column;

    padding: 30px 22px;

    margin: 14px 0;

    border-radius: 10px;

    transition: background-color 0.2s ease;
}


/* Novice - Gray */

.trade-tier.novice {
    background-color: rgba(130, 130, 130, 0.10);
}

.trade-tier.novice .trade-tier-title {
    color: #b8b8b8;
}


/* Apprentice - Green */

.trade-tier.apprentice {
    background-color: rgba(70, 165, 95, 0.12);
}

.trade-tier.apprentice .trade-tier-title {
    color: #6fdd91;
}


/* Journeyman - Blue */

.trade-tier.journeyman {
    background-color: rgba(65, 125, 200, 0.12);
}

.trade-tier.journeyman .trade-tier-title {
    color: #72aee6;
}


/* Expert - Purple */

.trade-tier.expert {
    background-color: rgba(135, 80, 190, 0.13);
}

.trade-tier.expert .trade-tier-title {
    color: #b58ae6;
}


/* Master - Gold */

.trade-tier.master {
    background-color: rgba(210, 175, 55, 0.13);
}

.trade-tier.master .trade-tier-title {
    color: #e0c45c;
}

.trade-disclaimer {
    margin-top: auto;
    padding-top: 20px;

    color: #e57373;
    font-size: 0.85rem;
    font-style: italic;
    text-align: left;
}


/* =========================
   Trade Tier Titles
========================= */

.trade-tier-title {
    margin: 0 0 18px;

    font-size: 1.35rem;

    text-align: center;

    letter-spacing: 0.04em;
}


/* =========================
   Trade List
========================= */

.trade-list {
    width: min(100%, 820px);

    margin: 0 auto;
}


/* =========================
   Individual Trade Rows
========================= */

.trade-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 13px 15px;
    margin-bottom: 8px;

    background-color: rgba(255, 255, 255, 0.025);

    border: 1px solid rgba(255, 255, 255, 0.035);
    border-radius: 7px;
}

.trade-row:last-child {
    margin-bottom: 0;
}


/* Keyboard focus for trades with extra popup information */

.trade-row[tabindex="0"]:focus-visible {
    outline: 2px solid #6fdd91;
    outline-offset: 2px;
}


/* =========================
   Trade Description
========================= */

.trade-description {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    min-width: 0;

    color: #eeeeee;
}


/* =========================
   Individual Trade Items
========================= */

.trade-item {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    white-space: nowrap;
}

.trade-item-icon {
    width: 30px;
    height: 30px;

    object-fit: contain;

    image-rendering: pixelated;

    flex-shrink: 0;
}


/* =========================
   + Symbol
========================= */

.trade-symbol {
    color: #b7b7b7;

    font-size: 1rem;

    flex-shrink: 0;
}


/* =========================
   Minecraft Trade Arrow
========================= */

.trade-arrow {
    width: 36px;
    height: 22px;

    object-fit: contain;

    image-rendering: pixelated;

    margin: 0 5px;

    flex-shrink: 0;
}


/* =========================
   Trade Chance
========================= */

.trade-chance {
    flex-shrink: 0;

    color: #888888;

    font-size: 0.84rem;

    white-space: nowrap;
}


/* =========================
   Guide / Related References
========================= */

.villager-guide-section,
.related-references {
    padding: 26px 40px;

    text-align: center;

    border-top: 1px solid #353535;
}

.villager-guide-section p,
.related-references p {
    margin: 0;
}

.villager-guide-section a,
.related-references a {
    color: #6fdd91;

    text-decoration: none;
}

.villager-guide-section a:hover,
.related-references a:hover {
    text-decoration: underline;
}


/* =========================
   Utility
========================= */

.hidden {
    display: none !important;
}


/* =========================
   Mobile Layout
========================= */

@media (max-width: 650px) {

    .villager-helper-page {
        width: min(100% - 20px, 1050px);

        padding-top: 28px;
    }


    /* Villager Profile */

    .villager-profile {
        padding: 26px 20px;
    }

    #villager-picture {
        display: none;
    }

    .profile-info {
        min-width: 0;
        width: 100%;

        text-align: center;
    }

    .villager-health {
        justify-content: center;
    }


    /* Main Sections */

    .enchanted-books-section,
    .trade-progression,
    .villager-guide-section,
    .related-references {
        padding-left: 18px;
        padding-right: 18px;
    }


    /* Search */

    .searchable-select-options {
        max-height: 280px;
    }


    /* Enchanted Books */

    .enchanted-book-list {
        width: 100%;
    }

    .enchanted-book-option {
        text-align: center;
    }

    .enchanted-book-levels {
        justify-content: center;
    }


    /* Book Details */

    .back-button {
        margin-bottom: 20px;
    }

    .book-title {
        font-size: 1.3rem;
    }

    .book-trade {
        padding: 20px 14px;
    }

    .book-trade-gives {
        gap: 8px;
    }

    .book-trade .trade-item-icon {
        width: 30px;
        height: 30px;
    }

    .trade-arrow-down {
        width: 34px;
        height: 22px;
    }

    .book-trade-receives {
        max-width: 100%;
    }


    /* Trade Rows */

    .trade-row {
        flex-direction: column;
        align-items: flex-start;

        gap: 8px;
    }

    .trade-description {
        gap: 6px;
    }

    .trade-item {
        gap: 5px;
    }

    .trade-item-icon {
        width: 26px;
        height: 26px;
    }

    .trade-arrow {
        width: 32px;
        height: 20px;

        margin: 0 2px;
    }

    .trade-chance {
        font-size: 0.8rem;
    }
}


/* =========================
   COLOR VARIANT POPUP
========================= */

/* The trade row becomes the positioning anchor for its popup */

.trade-row {
    position: relative;
}


/* Main popup */

.color-popup {
    position: absolute;
    z-index: 50;

    left: 50%;
    bottom: calc(100% + 10px);

    width: max-content;
    max-width: 340px;
    box-sizing: border-box;

    padding: 14px;

    background-color: #202020;
    border: 1px solid #55b879;
    border-radius: 10px;

    box-shadow: 0 8px 22px rgba(0, 0, 0, .55);

    /* Hidden until the trade is hovered */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .15s ease,
        visibility .15s ease,
        transform .15s ease;

    transform: translateX(-50%) translateY(5px);
}


/* Show popup when hovering or focusing its trade */

.trade-row:hover .color-popup,
.trade-row:focus-within .color-popup {
    opacity: 1;
    visibility: visible;

    transform: translateX(-50%) translateY(0);
}


/* ---------- Popup title ---------- */

.color-popup-title {
    margin: 0 0 12px;

    font-size: .95rem;
    font-weight: 700;
    text-align: center;

    background: linear-gradient(
        90deg,
        #ff6b6b,
        #f5a142,
        #f4d84a,
        #7ed957,
        #6ec5e9,
        #b47be3,
        #f29bc2
    );

    background-clip: text;
    -webkit-background-clip: text;

    color: transparent;
}

.color-popup-title::after {
    content: "";
    display: block;

    width: 90%;
    height: 2px;

    margin: 7px auto 0;

    background: linear-gradient(
        90deg,
        transparent 0%,
        #ff6b6b 15%,
        #f5a142 27%,
        #f4d84a 39%,
        #7ed957 50%,
        #6ec5e9 61%,
        #b47be3 73%,
        #f29bc2 85%,
        transparent 100%
    );

    border-radius: 999px;
}


/* ---------- 4x4 color grid ---------- */

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(55px, 1fr));

    gap: 10px 12px;
}


/* Each dye + name */

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    min-width: 0;

    text-align: center;
}


/* Minecraft dye texture */

.color-option img {
    width: 32px;
    height: 32px;

    object-fit: contain;

    margin-bottom: 4px;

    image-rendering: pixelated;
}


/* Dye name */

.color-option span {
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.1;

    white-space: nowrap;
}


/* ---------- Disclaimer ---------- */

.color-popup .disclaimer {
    display: block;

    margin-top: 12px;
    padding-top: 10px;

    border-top: 1px solid #3d3d3d;

    color: #a8a8a8;
    font-size: .72rem;
    font-style: italic;
    line-height: 1.35;

    text-align: center;
}


/* ---------- Little popup arrow ---------- */

.color-popup::after {
    content: "";

    position: absolute;

    top: 100%;
    left: 50%;

    transform: translateX(-50%);

    border: 7px solid transparent;
    border-top-color: #55b879;
}


/* ---------- Smaller screens ---------- */

@media (max-width: 650px) {

    .color-popup {
        max-width: min(300px, calc(100vw - 40px));
        padding: 12px;
    }

    .color-grid {
        grid-template-columns: repeat(4, minmax(45px, 1fr));
        gap: 9px 8px;
    }

    .color-option img {
        width: 28px;
        height: 28px;
    }

    .color-option span {
        font-size: .68rem;
    }
}


/* =========================
   BOAT BIOME POPUP
========================= */

.boat-popup {
    position: absolute;
    z-index: 50;

    left: 50%;
    bottom: calc(100% + 10px);

    transform: translateX(-50%) translateY(5px);

    width: max-content;
    min-width: 180px;
    max-width: 280px;
    box-sizing: border-box;

    padding: 14px;

    background-color: #202020;
    border: 1px solid #55b879;
    border-radius: 10px;

    box-shadow: 0 8px 22px rgba(0, 0, 0, .55);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .15s ease,
        visibility .15s ease,
        transform .15s ease;
}


/* Show popup when hovering or focusing the boat trade */

.trade-row:hover .boat-popup,
.trade-row:focus-within .boat-popup {
    opacity: 1;
    visibility: visible;

    transform: translateX(-50%) translateY(0);
}


/* ---------- Title ---------- */

.boat-popup-title {
    margin: 0 0 10px;

    color: #e8e8e8;
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
}


/* Little green fading line underneath */

.boat-popup-title::after {
    content: "";
    display: block;

    width: 85%;
    height: 2px;

    margin: 7px auto 0;

    background: linear-gradient(
        90deg,
        transparent,
        #55b879,
        transparent
    );

    border-radius: 999px;
}


/* ---------- Biome list ---------- */

.boat-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}


/* Individual biome */

.biome-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;
    padding: 6px 8px;

    background-color: #282828;
    border: 1px solid #383838;
    border-radius: 7px;
}


/* Biome icon */

.biome-option img {
    width: 30px;
    height: 30px;

    object-fit: contain;
    flex-shrink: 0;

    image-rendering: pixelated;
}


/* Biome name */

.biome-option span {
    color: #dddddd;
    font-size: .8rem;
    font-weight: 600;
}


/* ---------- Popup arrow ---------- */

.boat-popup::after {
    content: "";

    position: absolute;

    top: 100%;
    left: 50%;

    transform: translateX(-50%);

    border: 7px solid transparent;
    border-top-color: #55b879;
}


/* ---------- Mobile sizing ---------- */

@media (max-width: 650px) {

    .boat-popup {
        min-width: 160px;
        max-width: min(240px, calc(100vw - 40px));
        padding: 12px;
    }

    .biome-option img {
        width: 27px;
        height: 27px;
    }

    .biome-option span {
        font-size: .75rem;
    }
}


/* =========================
   SUSPICIOUS STEW POPUP
========================= */

.trade-row {
    position: relative;
}

.stew-popup {
    position: absolute;
    z-index: 50;

    left: 50%;
    bottom: calc(100% + 10px);

    width: 430px;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;

    padding: 14px;

    background-color: #202020;
    border: 1px solid #9b6bd6;
    border-radius: 10px;

    box-shadow: 0 8px 22px rgba(0, 0, 0, .55);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateX(-50%) translateY(5px);

    transition:
        opacity .15s ease,
        visibility .15s ease,
        transform .15s ease;
}


/* Show popup when hovering or focusing the Suspicious Stew trade */

.trade-row:hover .stew-popup,
.trade-row:focus-within .stew-popup {
    opacity: 1;
    visibility: visible;

    transform: translateX(-50%) translateY(0);
}


/* =========================
   TITLE
========================= */

.stew-popup-title {
    margin: 0 0 12px;

    color: #c79aee;
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
}


/* Fading purple line */

.stew-popup-title::after {
    content: "";
    display: block;

    width: 85%;
    height: 2px;

    margin: 7px auto 0;

    background: linear-gradient(
        90deg,
        transparent 0%,
        #9b6bd6 50%,
        transparent 100%
    );

    border-radius: 999px;
}


/* =========================
   EFFECT GRID
========================= */

.stew-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 8px;
}


/* =========================
   EFFECT OPTION
========================= */

.stew-option {
    display: grid;

    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;

    column-gap: 10px;
    row-gap: 2px;

    align-items: center;

    min-width: 0;

    padding: 8px 10px;

    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;

    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, .05),
        inset -1px -1px 0 rgba(0, 0, 0, .35);
}


/* Effect icon */

.stew-option img {
    grid-column: 1;
    grid-row: 1 / 3;

    width: 32px;
    height: 32px;

    object-fit: contain;
    flex-shrink: 0;

    image-rendering: pixelated;
}


/* Effect name */

.effect-name-text {
    grid-column: 2;
    grid-row: 1;

    color: #f1f1f1;

    font-size: .84rem;
    font-weight: 600;
    line-height: 1.1;

    white-space: nowrap;
}


/* Effect duration */

.effect-duration-text {
    grid-column: 2;
    grid-row: 2;

    color: #999;

    font-size: .7rem;
    font-weight: 400;
    line-height: 1.1;
}


/* =========================
   POPUP ARROW
========================= */

.stew-popup::after {
    content: "";

    position: absolute;

    top: 100%;
    left: 50%;

    transform: translateX(-50%);

    border: 7px solid transparent;
    border-top-color: #9b6bd6;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 650px) {

    .stew-popup {
        width: min(330px, calc(100vw - 40px));

        padding: 12px;
    }

    .stew-grid {
        grid-template-columns: 1fr;

        gap: 7px;
    }

    .stew-option {
        padding: 7px 9px;
    }

    .stew-option img {
        width: 30px;
        height: 30px;
    }

    .effect-name-text {
        font-size: .8rem;
    }

    .effect-duration-text {
        font-size: .68rem;
    }
}


/* =========================
   ARROW POPUP
========================= */

.arrow-popup {
    position: absolute;

    bottom: calc(100% + 10px);
    left: 50%;

    transform: translateX(-50%);

    width: min(520px, 90vw);

    padding: 14px;

    background: #161616;

    border: 2px solid #4f9cff;
    border-radius: 10px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.15s ease,
        visibility 0.15s ease;

    z-index: 20;
}

.trade-row:hover .arrow-popup,
.trade-row:focus-within .arrow-popup {
    opacity: 1;
    visibility: visible;
}


/* =========================
   TITLE
========================= */

.arrow-popup-title {
    position: relative;

    margin: 0 0 12px;
    padding-bottom: 10px;

    text-align: center;

    font-size: 1rem;
    font-weight: 700;

    color: #78b8ff;
}


/* Fading divider underneath title */

.arrow-popup-title::after {
    content: "";

    position: absolute;

    bottom: 0;
    left: 50%;

    transform: translateX(-50%);

    width: 100%;
    height: 1px;

    background: linear-gradient(
        to right,
        transparent,
        #4f9cff 20%,
        #4f9cff 80%,
        transparent
    );
}


/* =========================
   GRID
========================= */

.arrow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 8px;
}


/* Put the final arrow type in the middle */

.arrow-option:last-child {
    grid-column: 2;
}


/* =========================
   ARROW OPTION
========================= */

.arrow-option {
    display: grid;

    grid-template-columns: 32px 1fr;

    grid-template-areas:
        "icon name"
        "icon variants";

    column-gap: 8px;
    row-gap: 2px;

    align-items: center;

    padding: 8px;

    background: #202020;

    border: 1px solid #333;
    border-radius: 7px;
}

.arrow-option img {
    grid-area: icon;

    width: 32px;
    height: 32px;

    object-fit: contain;

    image-rendering: pixelated;
}

.tipped-arrow-effect-name {
    grid-area: name;

    font-size: 0.85rem;
    font-weight: 600;

    color: #9dcbff;

    line-height: 1.1;
}


/* =========================
   VARIANTS
========================= */

.tipped-arrow-effect-variants {
    grid-area: variants;

    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 2px 4px;

    font-size: 0.7rem;
    line-height: 1.2;

    color: #aaa;
}

.tipped-arrow-effect-label {
    color: #cfcfcf;
}

.tipped-arrow-duration {
    color: #8e8e8e;
}


/* =========================
   DISCLAIMER
========================= */

.arrow-popup-disclaimer {
    margin: 12px 0 0;
    padding-top: 10px;

    border-top: 1px solid #444;

    text-align: center;

    font-size: 0.7rem;
    line-height: 1.3;

    color: #999;
}


/* =========================
   POPUP ARROW
========================= */

.arrow-popup::after {
    content: "";

    position: absolute;

    top: 100%;
    left: 50%;

    transform: translateX(-50%);

    border: 7px solid transparent;
    border-top-color: #4f9cff;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 650px) {

    .arrow-popup {
        width: min(360px, calc(100vw - 40px));

        padding: 12px;
    }

    .arrow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 7px;
    }

    .arrow-option {
        padding: 7px 9px;
    }

    .arrow-option img {
        width: 30px;
        height: 30px;
    }

    .tipped-arrow-effect-name {
        font-size: 0.8rem;
    }

    .tipped-arrow-effect-variants {
        font-size: 0.68rem;
    }

    /* 19 items means the last one still sits centered */
    .arrow-option:last-child {
        grid-column: 1 / -1;

        width: calc(50% - 4px);

        justify-self: center;
    }
}


@media (max-width: 420px) {

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

    .arrow-option:last-child {
        grid-column: auto;

        width: auto;

        justify-self: stretch;
    }
}


/* =========================
   LAYERED TRADE ITEMS
========================= */

.tipped-arrow-layers,
.leather-layers {
    position: relative;

    width: 32px;
    height: 32px;

    flex-shrink: 0;
}


/* Both layers occupy the exact same space */

.tipped-arrow-base,
.tipped-arrow-overlay,
.leather-base,
.leather-overlay {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;

    image-rendering: pixelated;
}


/* =========================
   TIPPED ARROW
========================= */

/* Keep the normal arrow portion untouched */

.tipped-arrow-base {
    z-index: 1;
}


/* Color only the tipped-arrow potion layer */

.tipped-arrow-overlay {
    z-index: 2;

    filter:
        grayscale(100%)
        sepia(100%)
        saturate(500%)
        hue-rotate(245deg)
        brightness(62%)
        contrast(125%);
}


/* =========================
   DYED LEATHER
========================= */

.leather-base {
    z-index: 2;
}

.leather-overlay {
    z-index: 1;

    filter:
        grayscale(100%)
        sepia(100%)
        saturate(350%)
        brightness(55%)
        contrast(145%);

    animation: rainbow-leather 3s linear infinite;
}

@keyframes rainbow-leather {

    0% {
        filter:
            grayscale(100%)
            sepia(100%)
            saturate(350%)
            hue-rotate(0deg)
            brightness(55%)
            contrast(145%);
    }

    100% {
        filter:
            grayscale(100%)
            sepia(100%)
            saturate(350%)
            hue-rotate(360deg)
            brightness(55%)
            contrast(145%);
    }
}


@media (max-width: 420px) {

    .trade-item {
        min-width: 0;
        max-width: 100%;
    }

    .trade-item > span:last-child {
        min-width: 0;

        white-space: normal;
        overflow-wrap: normal;

        line-height: 1.2;
    }
}