.amt-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    vertical-align: middle;
    margin: 2px 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
}

.amt-badge-wrapper {
    width: 140px;
    margin-bottom: 8px;
    display: block;
}

.amt-badge-inline {
    padding: 2px 8px;
    font-size: 11px;
    margin: 0 0 0 6px;
    box-shadow: none;
    white-space: nowrap;
    width: auto;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    position: relative;
    top: -1px;
}

.amt-my-titles-wrap {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.amt-profile-display {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.amt-notice {
    background: #e8f5e9;
    color: #1d1d1f;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.amt-titles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.amt-title-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    color: inherit;
    min-height: 100px;
}

/* Card Backgrounds based on Rarity (Pop Art Soft Colors for Dark/Light Mode) */
.amt-card-legendary { background-color: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.3); }
.amt-card-epic { background-color: rgba(168, 85, 247, 0.15); border-color: rgba(168, 85, 247, 0.3); }
.amt-card-rare { background-color: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); }
.amt-card-common { background-color: rgba(100, 116, 139, 0.15); border-color: rgba(100, 116, 139, 0.3); }
.amt-card-none { background-color: rgba(150, 150, 150, 0.1); border-color: rgba(150, 150, 150, 0.3); }

.amt-title-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.amt-card-legendary:hover { border-color: rgba(245, 158, 11, 0.8); background-color: rgba(245, 158, 11, 0.25); }
.amt-card-epic:hover { border-color: rgba(168, 85, 247, 0.8); background-color: rgba(168, 85, 247, 0.25); }
.amt-card-rare:hover { border-color: rgba(59, 130, 246, 0.8); background-color: rgba(59, 130, 246, 0.25); }
.amt-card-common:hover { border-color: rgba(100, 116, 139, 0.8); background-color: rgba(100, 116, 139, 0.25); }
.amt-card-none:hover { border-color: rgba(150, 150, 150, 0.8); background-color: rgba(150, 150, 150, 0.25); }

.amt-title-card.amt-active-card {
    border-color: #007aff;
    box-shadow: 0 0 0 2px #007aff;
}

.amt-title-card.amt-active-card::after {
    content: 'Sélectionné';
    position: absolute;
    top: -10px;
    right: 12px;
    background-color: #007aff;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amt-title-card.amt-pending-save {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px #f59e0b;
}

.amt-title-card.amt-pending-save::after {
    content: 'À Enregistrer';
    background-color: #f59e0b;
}

.amt-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.amt-desc {
    font-size: 12px;
    color: inherit;
    opacity: 0.7;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.amt-active-title-showcase {
    padding: 20px;
    margin-bottom: 32px; 
    border-radius: 12px;
    border: 1px solid rgba(150, 150, 150, 0.3);
    background: transparent;
    color: inherit;
}

.amt-rarity-section {
    margin-bottom: 32px;
}

.amt-empty-tier {
    padding: 24px;
    border-radius: 12px;
    background: transparent;
    border: 1px dashed rgba(150, 150, 150, 0.4);
    text-align: center;
    color: inherit;
    opacity: 0.6;
    font-size: 14px;
    font-style: italic;
}

.amt-empty-tier p {
    margin: 0;
}

.amt-btn {
    background: #007aff;
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.amt-btn:hover {
    background: #006ce6;
}

/* Achievement Popup */
.amt-popup {
    position: fixed;
    bottom: -150px;
    right: 20px;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 99999;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #d2d2d7;
    min-width: 250px;
}

.amt-popup.show {
    bottom: 30px;
}

.amt-popup-content h4 {
    margin: 0 0 10px 0;
    color: #1d1d1f;
    font-size: 16px;
    font-weight: 600;
}

.amt-popup-content p {
    margin: 0;
    font-size: 14px;
    color: #86868b;
}

/* Rarity Group Headings */
.amt-heading-legendary {
    color: #f59e0b;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}
.amt-heading-legendary::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    margin-right: 8px;
}

.amt-heading-epic {
    color: #a855f7;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}
.amt-heading-epic::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a855f7;
    margin-right: 8px;
}

.amt-heading-rare {
    color: #3b82f6;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}
.amt-heading-rare::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    margin-right: 8px;
}

.amt-heading-common {
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}
.amt-heading-common::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    margin-right: 8px;
}

/* Optional: Rarity Badges styling (fallback if inline styles aren't fully covering it) */
.amt-rarity-legendary { background-color: #f59e0b !important; box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4); }
.amt-rarity-epic { background-color: #a855f7 !important; box-shadow: 0 2px 6px rgba(168, 85, 247, 0.4); }
.amt-rarity-rare { background-color: #3b82f6 !important; box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4); }
.amt-rarity-common { background-color: #64748b !important; box-shadow: 0 2px 6px rgba(100, 116, 139, 0.3); }
