/* ── Collection Room ────────────────────────────────────────────── */

.mm-coll-wrap {
    max-width: 1100px;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* Header */
.mm-coll-header {
    margin-bottom: 2rem;
}

.mm-coll-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.mm-coll-title-row h1 {
    font-size: 1.8rem;
    margin: 0;
}

/* Completion progress bar */
.mm-coll-progress-wrap {
    margin-bottom: 1rem;
}

.mm-coll-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--mm-text-muted, #888);
    margin-bottom: 0.4rem;
}

.mm-coll-progress-bar {
    height: 10px;
    background: var(--mm-border, #e0e0e0);
    border-radius: 999px;
    overflow: hidden;
}

.mm-coll-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e05a00, #f5a623);
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* Rarity pills row */
.mm-coll-rarity-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.mm-coll-rarity-pill {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

/* Rarity color palette */
.mm-rarity-common    { background: #f0f0f0; color: #555; border-color: #ccc; }
.mm-rarity-uncommon  { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.mm-rarity-rare      { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.mm-rarity-epic      { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.mm-rarity-legendary { background: #fff8e1; color: #e65100; border-color: #ffcc02; }

/* Daily chest row on collection page */
.mm-coll-chest-row {
    margin-bottom: 2.5rem;
}

/* Filter bar */
.mm-coll-filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.mm-coll-filter {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--mm-border, #ddd);
    background: var(--mm-card-bg, #fff);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mm-text, #333);
    transition: background 0.15s, color 0.15s;
}

.mm-coll-filter:hover,
.mm-coll-filter-active {
    background: var(--mm-accent, #e05a00);
    color: #fff;
    border-color: var(--mm-accent, #e05a00);
}

.mm-rarity-btn-common:hover,
.mm-rarity-btn-common.mm-coll-filter-active    { background: #555; border-color: #555; }
.mm-rarity-btn-uncommon:hover,
.mm-rarity-btn-uncommon.mm-coll-filter-active  { background: #2e7d32; border-color: #2e7d32; }
.mm-rarity-btn-rare:hover,
.mm-rarity-btn-rare.mm-coll-filter-active      { background: #1565c0; border-color: #1565c0; }
.mm-rarity-btn-epic:hover,
.mm-rarity-btn-epic.mm-coll-filter-active      { background: #6a1b9a; border-color: #6a1b9a; }
.mm-rarity-btn-legendary:hover,
.mm-rarity-btn-legendary.mm-coll-filter-active { background: #e65100; border-color: #e65100; }

/* Grid */
.mm-coll-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

/* Item card */
.mm-coll-item {
    background: var(--mm-card-bg, #fff);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: default;
}

.mm-coll-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.mm-coll-item.mm-rarity-common    { border-color: #ccc; }
.mm-coll-item.mm-rarity-uncommon  { border-color: #a5d6a7; }
.mm-coll-item.mm-rarity-rare      { border-color: #90caf9; }
.mm-coll-item.mm-rarity-epic      { border-color: #ce93d8; box-shadow: 0 0 8px rgba(106,27,154,0.2); }
.mm-coll-item.mm-rarity-legendary {
    border-color: #ffcc02;
    box-shadow: 0 0 14px rgba(230,81,0,0.35);
    animation: mm-legendary-glow 2.5s ease-in-out infinite alternate;
}

@keyframes mm-legendary-glow {
    from { box-shadow: 0 0 8px rgba(230,81,0,0.2); }
    to   { box-shadow: 0 0 22px rgba(255,204,2,0.6); }
}

.mm-coll-item-art {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--mm-border, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mm-coll-item-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.mm-coll-item-placeholder {
    font-size: 3rem;
    opacity: 0.4;
}

.mm-coll-rarity-gem {
    position: absolute;
    bottom: 4px;
    right: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mm-rarity-gem-common    { background: #aaa; }
.mm-rarity-gem-uncommon  { background: #2e7d32; }
.mm-rarity-gem-rare      { background: #1565c0; }
.mm-rarity-gem-epic      { background: #6a1b9a; }
.mm-rarity-gem-legendary { background: #e65100; }

.mm-coll-copies {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0,0,0,0.55);
    color: #fff;
    padding: 1px 5px;
    border-radius: 999px;
}

.mm-coll-item-info {
    padding: 0.6rem 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mm-coll-item-name {
    font-size: 0.88rem;
    line-height: 1.3;
}

.mm-coll-item-cat {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mm-text-muted, #999);
}

.mm-coll-item-desc {
    font-size: 0.78rem;
    color: var(--mm-text-muted, #888);
    margin: 0;
    line-height: 1.4;
}

.mm-coll-item-found {
    font-size: 0.72rem;
    color: var(--mm-text-muted, #bbb);
    margin-top: 0.25rem;
}

/* Empty state */
.mm-coll-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--mm-text-muted, #888);
    font-size: 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

/* ── Daily Chest Widget ──────────────────────────────────────────── */

.mm-chest-wrap {
    background: var(--mm-card-bg, #fff);
    border: 2px solid var(--mm-border, #e0c98a);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    max-width: 480px;
}

.mm-chest-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.mm-chest-icon { font-size: 1.4rem; }

.mm-chest-premium-tag {
    margin-left: auto;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #f9d923, #f5a623);
    color: #5a3e00;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
}

.mm-chest-teaser { font-size: 0.9rem; color: var(--mm-text-muted, #888); margin: 0; }

/* ── Already claimed state ───────────────────────────────────────── */
.mm-chest-done {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--mm-text-muted, #666);
    margin-bottom: 0.6rem;
}
.mm-chest-check { color: #2e7d32; font-weight: 700; font-size: 1.1rem; }

.mm-chest-already-found {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.6rem;
}
.mm-chest-already-found.mm-rarity-common    { background: #f9f9f9; border: 1px solid #ccc; }
.mm-chest-already-found.mm-rarity-uncommon  { background: #f1f8f1; border: 1px solid #a5d6a7; }
.mm-chest-already-found.mm-rarity-rare      { background: #e8f4fd; border: 1px solid #90caf9; }
.mm-chest-already-found.mm-rarity-epic      { background: #f9f0ff; border: 1px solid #ce93d8; }
.mm-chest-already-found.mm-rarity-legendary { background: #fffbea; border: 1px solid #ffcc02; }
.mm-chest-already-found.mm-rarity-limited   { background: #fffde7; border: 1px solid #ffd700; }

.mm-chest-already-found .mm-chest-item-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

.mm-chest-comeback {
    font-size: 0.82rem;
    color: var(--mm-text-muted, #999);
    margin: 0 0 0.4rem;
}

.mm-chest-view-link {
    font-size: 0.85rem;
    color: var(--mm-accent, #e05a00);
    text-decoration: none;
    display: inline-block;
}
.mm-chest-view-link:hover { text-decoration: underline; }

/* ── Animated chest (image-based) ───────────────────────────────── */

.mm-chest-stage {
    display: flex;
    justify-content: center;
    padding: 1rem 0 0.5rem;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.mm-chest-stage-out {
    opacity: 0;
    transform: translateY(-12px);
}

.mm-chest-clickable {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
}
.mm-chest-clickable:disabled { cursor: default; }

/* Image wrapper */
.mm-chest-img-wrap {
    position: relative;
    width: 160px;
    height: 140px;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
    animation: mm-chest-float 3s ease-in-out infinite;
    transition: filter 0.3s ease;
}
.mm-chest-clickable:not(:disabled):hover .mm-chest-img-wrap {
    filter: drop-shadow(0 10px 24px rgba(255,180,0,0.55));
}

@keyframes mm-chest-float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

/* Both images stacked */
.mm-chest-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.2s ease;
}
.mm-chest-img-closed { opacity: 1; z-index: 2; }
.mm-chest-img-open   { opacity: 0; z-index: 2; }
.mm-chest-img-hide   { opacity: 0 !important; }
.mm-chest-img-show   { opacity: 1 !important; }

/* Gold glow from the chest opening */
.mm-chest-glow {
    position: absolute;
    left: 10%; top: 0;
    width: 80%; height: 60%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 85%,
        rgba(255,230,80,1)   0%,
        rgba(255,160,0,0.8) 30%,
        rgba(255,80,0,0.4)  60%,
        transparent         80%);
    pointer-events: none;
    opacity: 0;
    transform: scaleY(0.3);
    z-index: 3;
    filter: blur(8px);
    mix-blend-mode: screen;
}
.mm-chest-glow-go {
    animation: mm-chest-glow-anim 2s ease-out forwards;
}
@keyframes mm-chest-glow-anim {
    0%   { opacity: 0;    transform: scaleY(0.3) scaleX(0.5); }
    12%  { opacity: 1;    transform: scaleY(1.15) scaleX(1.1); }
    45%  { opacity: 0.85; transform: scaleY(1.0)  scaleX(1.0); }
    100% { opacity: 0;    transform: scaleY(1.4)  scaleX(1.3); }
}

/* Shake */
.mm-chest-shaking {
    animation: mm-chest-shake 0.16s ease-in-out infinite !important;
}
@keyframes mm-chest-shake {
    0%,100% { transform: translateX(0) rotate(0deg); }
    20%     { transform: translateX(-6px) rotate(-2.5deg); }
    40%     { transform: translateX(6px)  rotate(2.5deg); }
    60%     { transform: translateX(-4px) rotate(-1.5deg); }
    80%     { transform: translateX(4px)  rotate(1.5deg); }
}

/* Particles container */
.mm-chest-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

/* Label below chest */
.mm-chest-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mm-text, #333);
    transition: opacity 0.2s;
}
.mm-chest-clickable:disabled .mm-chest-label { opacity: 0.5; }

/* ── Screen flash for high rarity ────────────────────────────────── */
.mm-chest-screen-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99998;
    animation: mm-chest-flash 0.55s ease-out forwards;
}
.mm-chest-flash-legendary { background: rgba(255,152,0,0.35); }
.mm-chest-flash-limited   { background: rgba(255,215,0,0.4); }
.mm-chest-flash-epic      { background: rgba(224,64,251,0.25); }

@keyframes mm-chest-flash {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* ── Card reveal area ────────────────────────────────────────────── */
.mm-chest-reveal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.mm-chest-reveal-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
}
.mm-chest-reveal-card.mm-rarity-common    { background: #f9f9f9; border: 1px solid #ccc; }
.mm-chest-reveal-card.mm-rarity-uncommon  { background: #f1f8f1; border: 1px solid #a5d6a7; }
.mm-chest-reveal-card.mm-rarity-rare      { background: #e8f4fd; border: 1px solid #90caf9; }
.mm-chest-reveal-card.mm-rarity-epic      { background: #f9f0ff; border: 1px solid #ce93d8; box-shadow: 0 0 12px rgba(156,39,176,0.25); }
.mm-chest-reveal-card.mm-rarity-legendary { background: #fffbea; border: 1px solid #ffcc02; box-shadow: 0 0 18px rgba(255,152,0,0.4); animation: mm-legendary-glow 2.5s ease-in-out infinite alternate; }
.mm-chest-reveal-card.mm-rarity-limited   { background: #fffde7; border: 1px solid #ffd700; box-shadow: 0 0 20px rgba(255,215,0,0.5); animation: mm-legendary-glow 2.5s ease-in-out infinite alternate; }

.mm-chest-reveal-art-wrap {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.55);
    border-radius: 8px;
    overflow: hidden;
}
.mm-chest-reveal-art {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mm-chest-reveal-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.mm-chest-new-badge {
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #e040fb, #7b1fa2);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    letter-spacing: 0.04em;
    animation: mm-badge-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.mm-chest-rarity-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mm-text-muted, #888);
}
.mm-chest-item-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mm-text, #222);
}
.mm-chest-item-desc {
    font-size: 0.8rem;
    color: var(--mm-text-muted, #888);
    margin: 0;
}
.mm-chest-item-emoji { font-size: 2.5rem; }

.mm-chest-bonus-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e65100;
    margin-top: 0.25rem;
}

.mm-chest-coll-btn {
    display: inline-block;
    font-size: 0.85rem;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 600px) {
    .mm-coll-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    .mm-coll-title-row h1 { font-size: 1.4rem; }
    .mm-chest-img-wrap { width: 120px; height: 105px; }
}
