/* ==========================================================================
   Trophy detail modal — opened by trophy-modal.js when a trophy is clicked
   ========================================================================== */

body.mm-trophy-modal-lock {
    overflow: hidden;
}

.mm-trophy-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    -webkit-tap-highlight-color: transparent;
}

.mm-trophy-modal.is-open {
    display: flex;
}

.mm-trophy-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 6, 18, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mm-trophy-modal-card {
    position: relative;
    width: min(540px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 24px 28px 28px;
    color: var(--mm-text-primary);
    background:
        linear-gradient(180deg, rgba(246, 194, 62, 0.16) 0%, rgba(0, 0, 0, 0.10) 35%, rgba(0, 0, 0, 0.40) 100%),
        rgba(20, 16, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-top-color: rgba(246, 194, 62, 0.45);
    border-bottom-color: rgba(0, 0, 0, 0.55);
    border-radius: 18px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -2px 0 rgba(0, 0, 0, 0.50),
        0 12px 36px rgba(0, 0, 0, 0.55);
    animation: mm-trophy-modal-in 180ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes mm-trophy-modal-in {
    from { transform: translateY(8px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1);     opacity: 1; }
}

/* Gold corner accents — same vibe as the trophy-case frame */
.mm-trophy-modal-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    pointer-events: none;
    background:
        radial-gradient(circle 10px at 12px 12px, rgba(246, 194, 62, 0.45), transparent 70%),
        radial-gradient(circle 10px at calc(100% - 12px) 12px, rgba(246, 194, 62, 0.45), transparent 70%);
}

.mm-trophy-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 120ms ease, background 120ms ease;
    z-index: 2;
}
.mm-trophy-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* ── Header ── */
.mm-trophy-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.mm-trophy-modal-header .mm-trophy {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    cursor: default;
}
.mm-trophy-modal-header .mm-trophy:hover {
    transform: none;
}

.mm-trophy-modal-header-text {
    min-width: 0;
}

.mm-trophy-modal-title {
    font-family: var(--mm-font-display);
    font-size: var(--mm-text-2xl);
    font-weight: 800;
    margin: 0 0 4px;
    color: var(--mm-text-heading);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.mm-trophy-modal-how {
    font-size: var(--mm-text-sm);
    color: var(--mm-text-secondary);
    margin: 0;
    line-height: 1.45;
}

/* ── Your stat ── */
.mm-trophy-modal-yourstat {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.30);
    border: 1px solid rgba(246, 194, 62, 0.25);
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.mm-trophy-modal-yourstat-num {
    font-family: var(--mm-font-display);
    font-size: 28px;
    font-weight: 900;
    color: var(--mm-accent-gold, #F6C23E);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
    line-height: 1;
}

.mm-trophy-modal-yourstat-label {
    font-family: var(--mm-font-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--mm-text-secondary);
}

/* ── Progress bar to next tier ── */
.mm-trophy-modal-progress {
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.mm-trophy-modal-progress-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
}

.mm-trophy-modal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--mm-accent-gold, #F6C23E) 70%, #fff 30%) 0%,
        var(--mm-accent-gold, #F6C23E) 100%);
    border-radius: 6px;
    transition: width 240ms ease;
}

.mm-trophy-modal-progress-label {
    margin-top: 6px;
    font-size: 12px;
    color: var(--mm-text-secondary);
    text-align: right;
}

.mm-trophy-modal-progress-maxed {
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(246, 194, 62, 0.10);
    border: 1px solid rgba(246, 194, 62, 0.45);
    border-radius: 10px;
    color: var(--mm-accent-gold, #F6C23E);
    font-size: 13px;
    text-align: center;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* ── Tier list ── */
.mm-trophy-modal-tier-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.mm-trophy-modal-tier {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.mm-trophy-modal-tier.is-earned {
    background: rgba(0, 0, 0, 0.10);
    border-color: rgba(46, 204, 113, 0.30);
}

.mm-trophy-modal-tier.is-current {
    background: rgba(246, 194, 62, 0.08);
    border-color: rgba(246, 194, 62, 0.55);
    box-shadow: 0 0 0 2px rgba(246, 194, 62, 0.15);
}

.mm-trophy-modal-tier-row1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.mm-trophy-modal-tier-num {
    font-family: var(--mm-font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--mm-text-muted);
    flex-shrink: 0;
}

.mm-trophy-modal-tier-name {
    font-family: var(--mm-font-display);
    font-size: 15px;
    font-weight: 800;
    color: var(--mm-text-primary);
    flex: 1 1 auto;
    min-width: 0;
}

.mm-trophy-modal-tier-badge {
    font-family: var(--mm-font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.mm-trophy-modal-tier-badge.is-current {
    background: color-mix(in srgb, var(--mm-accent-gold, #F6C23E) 22%, transparent);
    color: var(--mm-accent-gold, #F6C23E);
    border: 1px solid color-mix(in srgb, var(--mm-accent-gold, #F6C23E) 55%, transparent);
}
.mm-trophy-modal-tier-badge.is-earned {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.40);
}

.mm-trophy-modal-tier-desc {
    font-size: 13px;
    color: var(--mm-text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.mm-trophy-modal-tier-rarity {
    font-family: var(--mm-font-mono);
    font-size: 11px;
    color: var(--mm-text-muted);
    letter-spacing: 0.5px;
}
.mm-trophy-modal-tier-rarity.is-unknown {
    font-style: italic;
}

/* ── Footnote ── */
.mm-trophy-modal-footnote {
    margin-top: 14px;
    font-size: 11px;
    color: var(--mm-text-muted);
    text-align: center;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* ── Loading / error ── */
.mm-trophy-modal-loading,
.mm-trophy-modal-error {
    padding: 32px 0;
    text-align: center;
    color: var(--mm-text-secondary);
    font-size: 14px;
}
.mm-trophy-modal-error {
    color: #ff7a7a;
}

/* ── Mobile ── */
@media (max-width: 540px) {
    .mm-trophy-modal { padding: 12px; }
    .mm-trophy-modal-card { padding: 18px 18px 22px; }
    .mm-trophy-modal-header { gap: 12px; }
    .mm-trophy-modal-header .mm-trophy { width: 64px; height: 64px; }
    .mm-trophy-modal-title { font-size: var(--mm-text-xl); }
}
