/*!
 * Styles for the shared trade builder (static/js/trade-builder.js).
 *
 * Every class is prefixed `mpet-` so this can be dropped onto any page without
 * colliding with that page's own .modal / .tile / .pick rules.
 */

.mpet-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 9000;
    overflow-y: auto;
}

.mpet-modal {
    background: var(--bg2, #14141a);
    border: 1px solid var(--line, rgba(255, 255, 255, .1));
    border-radius: 16px;
    padding: 22px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    color: var(--text, #eee);
}

.mpet-modal.wide {
    max-width: 940px;
}

.mpet-modal h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    margin: 0 0 8px;
    letter-spacing: .3px;
}

.mpet-hint {
    color: var(--muted, #9aa);
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 14px;
}

.mpet-meta {
    color: var(--muted, #9aa);
    font-size: 11px;
}

.mpet-field {
    width: 100%;
    background: var(--black, #0b0b0e);
    border: 1px solid var(--line, rgba(255, 255, 255, .1));
    border-radius: 10px;
    padding: 11px 13px;
    color: var(--text, #eee);
    font: inherit;
    font-size: .95rem;
    margin-top: 12px;
}

.mpet-field:focus {
    outline: none;
    border-color: var(--red, #e5484d);
}

/* ---- two-column builder ---- */
.mpet-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width:720px) {
    .mpet-builder {
        grid-template-columns: 1fr;
    }
}

.mpet-col {
    border: 1px solid var(--line, rgba(255, 255, 255, .1));
    border-radius: 12px;
    padding: 12px;
}

.mpet-col.give {
    background: rgba(229, 72, 77, .05);
}

.mpet-col.get {
    background: rgba(52, 211, 153, .05);
}

.mpet-col h3 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    letter-spacing: .4px;
    margin: 0 0 10px;
}

.mpet-sum {
    color: var(--gold, #e5b53a);
    font-weight: 800;
    font-size: 14px;
}

.mpet-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.mpet-tile {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    text-align: center;
    background: rgba(0, 0, 0, .25);
    transition: border-color .15s, transform .15s;
}

.mpet-tile:hover {
    transform: translateY(-2px);
}

.mpet-tile.sel {
    border-color: var(--gold, #e5b53a);
    background: rgba(229, 181, 58, .12);
}

.mpet-tile img {
    width: 100%;
    aspect-ratio: 2.5/3.5;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    background: #0e0e12;
}

.mpet-tile .mpet-nm {
    font-size: 10px;
    font-weight: 700;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpet-credit {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted, #9aa);
}

.mpet-credit input {
    width: 74px;
    background: var(--black, #0b0b0e);
    border: 1px solid var(--line, rgba(255, 255, 255, .1));
    border-radius: 7px;
    padding: 5px 7px;
    color: var(--text, #eee);
    font: inherit;
    font-size: 12px;
}

/* ---- fairness meter ---- */
.mpet-fair {
    margin-top: 14px;
}

.mpet-fair-bar {
    position: relative;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
}

.mpet-fair-mid {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, .25);
}

.mpet-fair-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    transition: width .2s, left .2s;
}

.mpet-fair-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
}

.mpet-verdict {
    font-size: 12.5px;
    font-weight: 700;
}

.mpet-verdict.even {
    color: var(--green, #34d399);
}

.mpet-verdict.warn {
    color: var(--gold, #e5b53a);
}

.mpet-verdict.bad {
    color: var(--red, #e5484d);
}

/* ---- buttons ---- */
.mpet-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.mpet-btn {
    border: 1px solid var(--line, rgba(255, 255, 255, .1));
    border-radius: 10px;
    padding: 10px 18px;
    font: inherit;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.mpet-btn.sm {
    padding: 7px 13px;
    font-size: 12.5px;
}

.mpet-btn.ghost {
    background: transparent;
    color: var(--text, #eee);
}

.mpet-btn.gold {
    background: var(--gold, #e5b53a);
    border-color: var(--gold, #e5b53a);
    color: #14141a;
}

.mpet-btn:disabled {
    opacity: .6;
    cursor: default;
}

.mpet-nudge {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line, rgba(255, 255, 255, .1));
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted, #9aa);
}

.mpet-nudge b {
    color: var(--text, #eee);
}

.mpet-nudge a {
    margin-top: 8px;
}