/* ============================================
   MortalPins Components
   Buttons, controls, forms, cards, badges, rewards, artifacts
   ============================================ */

/* Buttons */
.mp-button-modern,
.mystery-banner-btn,
.mq-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.85rem;
    padding: .75rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 900;
    color: #0c0c14 !important;
    background: linear-gradient(135deg, var(--mp-gold), #fff2b8);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

    .mp-button-modern:hover,
    .mystery-banner-btn:hover,
    .mq-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 42px rgba(246, 200, 95, .22);
    }

    .mp-button-modern.ghost,
    .mq-button.mq-ghost {
        color: var(--mp-text) !important;
        background: rgba(255, 255, 255, .07);
        border-color: var(--mp-border);
    }

        .mp-button-modern.ghost:hover,
        .mq-button.mq-ghost:hover {
            border-color: rgba(246, 200, 95, .55);
        }

.controls .btn {
    background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
    border: 1px solid rgba(255,255,255,.08);
    color: var(--mp-gold);
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

    .controls .btn.primary {
        background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
        box-shadow: 0 6px 18px rgba(0,0,0,.25);
    }

/* Forms */
.mp-select-wrap,
.mp-input-wrap {
    position: relative;
    width: 100%;
}

.mp-select,
.mp-input,
.mp-textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .14);
    color: var(--mp-text);
    background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04)), rgba(13,13,26,.92);
    box-shadow: 0 14px 38px rgba(0,0,0,.25);
    backdrop-filter: blur(14px);
    font-weight: 750;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.mp-select,
.mp-input {
    min-height: 2.85rem;
    padding: .75rem 1rem;
    border-radius: 999px;
}

.mp-select {
    padding-right: 2.75rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.mp-textarea {
    min-height: 9rem;
    padding: 1rem;
    border-radius: 1.2rem;
    resize: vertical;
}

    .mp-select:hover,
    .mp-input:hover,
    .mp-textarea:hover {
        transform: translateY(-1px);
        border-color: rgba(246, 200, 95, .55);
        box-shadow: 0 18px 46px rgba(0,0,0,.32);
    }

    .mp-select:focus,
    .mp-input:focus,
    .mp-textarea:focus {
        border-color: rgba(246, 200, 95, .75);
        box-shadow: 0 0 0 .25rem rgba(246, 200, 95, .12), 0 18px 46px rgba(0,0,0,.32);
    }

.mp-select:disabled,
.mp-input:disabled,
.mp-input[readonly] {
    opacity: .55;
    cursor: not-allowed;
}

.mp-select-wrap::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mp-gold);
    font-size: .95rem;
    pointer-events: none;
}

.mp-select option,
.mp-select optgroup {
    color: var(--mp-text);
    background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04)), rgba(13,13,26,.92);
}

.mp-input::placeholder,
.mp-textarea::placeholder {
    color: rgba(168, 166, 189, .75);
}

.mp-select-label,
.mp-input-label,
.mp-field label {
    display: inline-block;
    margin-bottom: .45rem;
    color: var(--mp-muted);
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.mp-input-wrap.has-icon .mp-input {
    padding-left: 2.75rem;
}

.mp-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mp-gold);
    font-size: 1rem;
    pointer-events: none;
}

/* Artifact Cards */
.artifact-card {
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
}

    .artifact-card.active {
        border: solid #ebff00;
        box-shadow: 0 0 2rem 4px rgb(1 255 114 / 55%) !important;
    }

.artifact-image {
    width: 100%;
    display: block;
    object-fit: cover;
}

.artifact-link {
    display: block;
    text-decoration: none;
    border-radius: 10px;
}

.bookmark-btn {
    position: absolute;
    top: .5rem;
    left: .5rem;
    background: rgba(0,0,0,.6);
    border: none;
    padding: .3rem .6rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: .3rem;
    cursor: pointer;
    color: #fff;
}

/* Artifact detail */
.artifact-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
    color: #f5f5f7;
}

.artifact-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.artifact-tag {
    font-size: .8rem;
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.artifact-name {
    font-size: 1.6rem;
    margin: .25rem 0;
}

.artifact-subtitle {
    font-size: .9rem;
    opacity: .8;
    max-width: 32rem;
}

.artifact-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
}

.artifact-price {
    font-weight: 700;
    font-size: 1.1rem;
}

.artifact-main {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.artifact-visual {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.artifact-image-frame {
    border-radius: 18px;
    padding: .75rem;
    background: radial-gradient(circle at 20% 0, #5f37f2 0, transparent 55%), radial-gradient(circle at 80% 100%, #ca2294 0, transparent 55%), #050712;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .artifact-image-frame img {
        width: auto;
        height: 10rem;
        border-radius: 12px;
    }

.artifact-rarity-pill,
.artifact-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    margin-right: .35rem;
}

.artifact-core-stats .section-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .7;
    margin-bottom: .75rem;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    align-items: center;
}

.stat-value {
    font-size: .8rem;
    opacity: .8;
}

.stat-bar {
    grid-column: 1 / -1;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    overflow: hidden;
}

    .stat-bar > div {
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(135deg, var(--mp-gold), var(--mp-pink), var(--mp-blue));
        transition: width .4s ease-out;
    }

.artifact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.grid-card {
    padding: .9rem;
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
}

.grid-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .7;
    display: block;
    margin-bottom: .5rem;
}

.grid-pair {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    margin-bottom: .25rem;
}

    .grid-pair strong {
        font-weight: 600;
    }

.artifact-footer {
    margin-top: 1rem;
}

.artifact-actions {
    position: absolute;
    align-items: center;
    display: block;
    right: 1em;
}

.action-item {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.action-label {
    font-size: .8rem;
    opacity: .75;
}

.action-like {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .38rem .75rem;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    transition: .25s ease;
    backdrop-filter: blur(8px);
}

    .action-like:hover {
        background: rgba(255,255,255,.15);
        transform: translateY(-2px);
    }

    .action-like i {
        font-size: 1rem;
    }

.like-count {
    font-weight: 600;
    font-size: .85rem;
}

/* Switch */
.switch-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    opacity: .85;
}

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

    .switch input {
        display: none;
    }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,.18);
    border-radius: 999px;
    transition: .25s ease;
}

    .slider::before {
        content: "";
        position: absolute;
        height: 14px;
        width: 14px;
        left: 3px;
        top: 3px;
        background-color: white;
        border-radius: 50%;
        transition: .25s ease;
    }

.switch input:checked + .slider {
    background: linear-gradient(135deg,#5f37f2,#ca2294);
}

    .switch input:checked + .slider::before {
        transform: translateX(16px);
    }

/* Badges and boxes */
.badge-uncommon {
    background: linear-gradient(135deg,#4caf50,#81c784);
    color: #fff;
    border: 1px solid #2e7d32;
}

.badge-divine {
    background: linear-gradient(135deg,#8d5b0c,#ffeb3b);
    color: #4e342e;
    border: 1px solid #6f3808;
    text-shadow: 0 0 6px rgba(255,255,200,.8);
}

.badge-eternal {
    background: linear-gradient(135deg,#09060e,#9575cd);
    color: #fff;
    border: 1px solid #4527a0;
    text-shadow: 0 0 8px rgba(200,150,255,.9);
}

.badge-unique {
    background: linear-gradient(135deg,#040202,#f06292);
    color: #fff;
    border: 1px solid #c2185b;
    text-shadow: 0 0 6px rgba(255,100,150,.9);
}

.artifact-boxes {
    border-radius: 1em;
    width: 5em;
    background: #06040ce6;
    color: aliceblue;
    padding-block: 1em;
    margin: auto;
    cursor: pointer;
    opacity: .9;
}

    .artifact-boxes:hover {
        opacity: 1;
    }

.blue-box {
    background: #3800e9;
    color: #fff;
}

.legacy-box {
    background: #000000ed;
    color: #ffc107;
}

.red-box {
    background: #9d005b;
    color: aliceblue;
}

.green-box {
    background: #009d40;
    color: aliceblue;
}

.red-gold-box {
    background: #715c1e94;
    color: aliceblue;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 45%) !important;
}

.purp-box {
    color: aliceblue;
    background: linear-gradient(232deg, #3e1671 0%, #7ae21e 100%);
    box-shadow: 0 .5rem 1rem rgb(0 0 0 / 68%) !important;
}

.gradient-box {
    color: aliceblue;
    background: linear-gradient(232deg, #4e3aff 0%, #e21e80 100%);
    box-shadow: 0 .5rem 1rem rgb(0 0 0 / 68%) !important;
}

.fuse-box {
    color: aliceblue;
    background: linear-gradient(232deg, #3b1c1c 0%, #1e3de2 100%);
    box-shadow: 0 .5rem 1rem rgb(0 0 0 / 68%) !important;
}

/* Badge grid */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.badge-card {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .15);
    transition: .25s ease;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0,0,0,.25);
}

    .badge-card:hover {
        transform: translateY(-4px) scale(1.03);
        box-shadow: 0 0 18px rgba(0,0,0,.35);
    }

.badge-icon i {
    font-size: 2rem;
    margin-bottom: .4rem;
}

.badge-label {
    font-size: .85rem;
    opacity: .85;
    margin-bottom: .3rem;
    letter-spacing: .5px;
}

.badge-value {
    font-weight: 600;
    font-size: 1rem;
    padding: .3rem .6rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #6a5af9, #b44cff);
    color: white;
}

.founder .badge-icon i {
    color: #ffd86b;
}

.prestige .badge-icon i {
    color: #6bd4ff;
}

.legacy .badge-icon i {
    color: #caa6ff;
}

.hidden .badge-icon i {
    color: #ff6b6b;
}

.top-rank .badge-icon i {
    color: #ffe066;
}

.journey .badge-icon i {
    color: #7cffc4;
}

.top-power .badge-icon i {
    color: #ff9f43;
}

/* Progress */
.artifact-bar {
    height: 10px;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    box-shadow: inset 0 0 6px rgba(0,0,0,.4);
}

    .artifact-bar .progress-bar {
        border-radius: 6px;
        box-shadow: 0 0 8px rgba(255,255,255,.4);
    }

/* Ranking */
.rank-embed {
    --bg: #0f1220;
    --card: #171a2b;
    --text: #e8ebf7;
    --muted: #aab1c7;
    --accent: #7aa2ff;
    --border: #252946;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    max-width: 980px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

    .rank-embed h2 {
        margin: 0 0 14px 0;
        font-weight: 700;
        font-size: 1.25rem;
        letter-spacing: .2px;
    }

    .rank-embed p.intro {
        margin: 0 0 16px 0;
        color: var(--muted);
        font-size: .95rem;
    }

.rank-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
}

    .rank-table thead th {
        text-align: left;
        font-weight: 700;
        color: white;
        background: linear-gradient(180deg, #1b2038, #171a2b);
        border-bottom: 1px solid var(--border);
        padding: 12px 14px;
        font-size: .9rem;
    }

    .rank-table tbody td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--border);
        vertical-align: top;
        font-size: .93rem;
        line-height: 1.35;
    }

    .rank-table tbody tr:last-child td {
        border-bottom: none;
    }

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--accent);
}

.rank-icon {
    font-size: 1rem;
}

.rank-image {
    margin: auto;
    width: 8em;
    display: block;
    height: 8em;
}

.rank-border {
    border: solid .1em lightslategray;
    padding: 1em;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 1em;
}

/* Other UI components */
.live-icon {
    display: inline-flex;
    align-items: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: white;
    background: #d6208a;
    padding: 5px 10px;
    border-radius: 20px;
    position: relative;
}

.dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: .6;
    }
}

.break-even {
    min-width: 6.3em;
    margin: .2em;
    color: black;
    border: solid .1em;
}

.positive-break {
    margin: .2em;
    background: linear-gradient(90deg, #00ffcc, #0088ff);
}

.negative-break {
    margin: .2em;
    background: linear-gradient(90deg, #ff4d4d, #cc0000);
    color: white;
}

.trade-card {
    position: absolute;
    top: 3em;
    background: #000000;
    opacity: .9;
    visibility: hidden;
    pointer-events: none;
}

    .trade-card label {
        font-size: x-small !important;
    }

.profile-img-settings {
    border: 1px solid blue;
    display: block;
    height: 12em;
    border-radius: 8px;
}

/* Locked overlay */
.locked-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 9;
}

    .locked-overlay img {
        width: 80%;
        max-width: 300px;
        animation: sealPulse 3s ease-in-out infinite;
        filter: drop-shadow(0 0 12px #ffb300) brightness(1.2);
    }

@keyframes sealPulse {
    0%, 100% {
        transform: scale(1);
        opacity: .9;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Nexus dropdown */
.nexus-sort-toggle {
    position: relative;
    letter-spacing: .5px;
}

.nexus-dropdown {
    min-width: 220px;
    border-radius: 12px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 0 20px rgba(0,0,0,.35);
    animation: nexusFadeIn .25s ease-out;
}

.nexus-dropdown-item {
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: .15s ease;
}

    .nexus-dropdown-item:hover {
        background: rgba(255,255,255,.08);
        color: var(--mp-blue);
        transform: translateX(4px);
    }

@keyframes nexusFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Archive hero */
.archive-hero {
    position: relative;
    margin: 2rem 0 2.5rem;
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: calc(var(--mp-radius) * 1.25);
    overflow: hidden;
}

    .archive-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 85% 20%, rgba(124, 140, 255, .28), transparent 18rem), linear-gradient(135deg, rgba(246, 200, 95, .14), transparent 45%);
        pointer-events: none;
    }

    .archive-title,
    .archive-subtitle,
    .archive-hero .section-eyebrow {
        position: relative;
        z-index: 1;
    }

.archive-title {
    margin: .8rem 0 1rem;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    line-height: .9;
    font-weight: 950;
    letter-spacing: -.06em;
}

.archive-subtitle {
    max-width: 720px;
    color: var(--mp-muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

/* Mobile */
@media (max-width: 768px) {
    .artifact-shell {
        padding: 1rem;
    }

    .artifact-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .artifact-header-actions {
        align-items: flex-start;
    }

    .artifact-main {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 700px) {
    .rank-table thead {
        display: none;
    }

    .rank-table,
    .rank-table tbody,
    .rank-table tr,
    .rank-table td {
        display: block;
        width: 100%;
    }

        .rank-table tr {
            background: var(--card);
            margin-bottom: 12px;
            border: 1px solid var(--border);
            border-radius: 10px;
        }

        .rank-table td {
            border: none;
            padding: 10px 12px;
        }

            .rank-table td::before {
                content: attr(data-label);
                display: block;
                font-weight: 700;
                color: var(--muted);
                margin-bottom: 6px;
                font-size: .85rem;
            }
}
