/* ─── Series Completion Certificate ─────────────────────────────────────── */

.ao-cert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    animation: aoCertFadeIn 0.4s ease forwards;
}

@keyframes aoCertFadeIn {
    to { opacity: 1; }
}

.ao-cert-modal {
    position: relative;
    background: #0d0d18;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    max-width: 560px;
    width: 100%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
    transform: scale(0.9);
    animation: aoCertSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes aoCertSlideUp {
    from { transform: scale(0.9) translateY(20px); }
    to   { transform: scale(1)   translateY(0); }
}

.ao-cert-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
}

.ao-cert-close:hover { color: #fff; }

.ao-cert-badge {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: aoCertBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes aoCertBounce {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.ao-cert-headline {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.ao-cert-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.ao-cert-sub {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1.5rem;
}

/* Canvas certificate preview */
.ao-cert-canvas-wrap {
    margin: 0 auto 1.5rem;
    max-width: 480px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.ao-cert-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Rank badge */
.ao-cert-rank {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    color: #fbbf24;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Action buttons */
.ao-cert-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.ao-cert-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, opacity 0.15s;
    text-decoration: none;
}

.ao-cert-btn:hover { transform: translateY(-1px); opacity: 0.9; }
.ao-cert-btn:active { transform: none; }

.ao-cert-btn--download {
    background: #fbbf24;
    color: #000;
}

.ao-cert-btn--share {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 480px) {
    .ao-cert-modal { padding: 1.5rem 1rem; }
    .ao-cert-title { font-size: 1.15rem; }
    .ao-cert-actions { flex-direction: column; }
    .ao-cert-btn { justify-content: center; }
}

/* ─── Profile Certificates Grid ─────────────────────────────────────────── */

.ao-cert-profile-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem 0;
}

.ao-cert-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.ao-cert-profile-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ao-cert-profile-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.ao-cert-profile-card__cover-link {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #0d0d18;
}

.ao-cert-profile-card__cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.ao-cert-profile-card:hover .ao-cert-profile-card__cover {
    transform: scale(1.05);
}

.ao-cert-profile-card__cover--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.ao-cert-profile-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 0.6rem;
}

.ao-cert-profile-card__rank {
    background: #fbbf24;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.ao-cert-profile-card__info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.ao-cert-profile-card__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e8e8f0;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ao-cert-profile-card__range {
    font-size: 0.68rem;
    font-weight: 600;
    color: #fcd34d;
    opacity: 0.85;
}

.ao-cert-profile-card__date,
.ao-cert-profile-card__completers {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}

.ao-cert-profile-card__completers {
    color: rgba(251, 191, 36, 0.6);
}

/* Character avatars on profile card */
.ao-cert-profile-card__chars {
    display: flex;
    align-items: center;
    gap: -6px;
    margin: 0.15rem 0;
}

.ao-cert-profile-card__char-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(196, 181, 253, 0.3);
    overflow: hidden;
    background: #1e1c45;
    flex-shrink: 0;
    margin-right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #c4b5fd;
    position: relative;
    transition: transform 0.15s;
}

.ao-cert-profile-card__char-avatar:hover {
    transform: scale(1.15);
    z-index: 2;
}

.ao-cert-profile-card__char-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ao-cert-profile-card__char-more {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(167, 139, 250, 0.3);
    background: #2d1b69;
    flex-shrink: 0;
    margin-right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    color: #a78bfa;
}

.ao-cert-profile-dl-btn {
    margin-top: auto;
    padding: 0.45rem 0.75rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 6px;
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    text-align: center;
}

.ao-cert-profile-dl-btn:hover {
    background: rgba(251, 191, 36, 0.18);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .ao-cert-profile-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.875rem;
    }
}
