/* 諸神榮耀 · 勳章成就系統 */
.achieve-view {
    padding-bottom: 100px;
}

.achieve-hero {
    margin-bottom: 1.25rem;
    text-align: center;
}

.achieve-hero h2 {
    margin: 0 0 0.35rem;
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    background: linear-gradient(105deg, #f5d78e 0%, #fff8e7 40%, #c9a227 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.06em;
}

.achieve-hero__sub {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 220, 160, 0.75);
    letter-spacing: 0.12em;
}

.achieve-panel {
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 20px;
    padding: 1.25rem 1rem 1.5rem;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 0 40px rgba(120, 60, 200, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.achieve-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.achieve-tab {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(180, 140, 255, 0.35);
    background: rgba(30, 15, 50, 0.6);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.achieve-tab:hover {
    border-color: rgba(212, 175, 55, 0.6);
}

.achieve-tab.is-active {
    background: linear-gradient(135deg, rgba(120, 70, 200, 0.55), rgba(180, 130, 40, 0.45));
    border-color: rgba(245, 215, 142, 0.7);
    box-shadow: 0 0 16px rgba(180, 120, 255, 0.35);
}

.achieve-summary {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.achieve-stat {
    text-align: center;
    min-width: 72px;
}

.achieve-stat__val {
    display: block;
    font-family: Orbitron, sans-serif;
    font-size: 1.5rem;
    color: #e8d5a3;
}

.achieve-stat--glow .achieve-stat__val {
    color: #c9f;
    text-shadow: 0 0 12px rgba(180, 100, 255, 0.8);
}

.achieve-stat__lbl {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

/* 勳章網格：不設內層滾軸，全部直接展開（整頁可向下捲動） */
.achieve-grid-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
    margin-right: 0;
}

.achieve-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.achieve-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted, #888);
    padding: 2rem;
}

.achieve-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 1rem 1rem 0.85rem;
    background: rgba(12, 8, 24, 0.85);
    border: 1px solid rgba(140, 100, 200, 0.25);
    transition: transform 0.2s, box-shadow 0.25s;
    text-align: center;
}

.achieve-card:hover {
    transform: translateY(-2px);
}

.achieve-card__shine {
    position: absolute;
    inset: -50% -50% auto;
    height: 80%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.04) 50%,
        transparent 60%
    );
    transform: rotate(-8deg);
    pointer-events: none;
    animation: achieve-shine 4s ease-in-out infinite;
}

@keyframes achieve-shine {
    0%,
    100% {
        opacity: 0.3;
        transform: rotate(-8deg) translateX(-20%);
    }
    50% {
        opacity: 0.7;
        transform: rotate(-8deg) translateX(20%);
    }
}

.achieve-card--gold-glow {
    border-color: rgba(245, 215, 142, 0.55);
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.2);
}

.achieve-card--hell,
.achieve-card--hell-glow {
    border-color: rgba(220, 60, 60, 0.55);
    background: linear-gradient(145deg, rgba(28, 6, 12, 0.95), rgba(12, 4, 20, 0.92));
    box-shadow:
        0 0 28px rgba(180, 40, 80, 0.25),
        inset 0 0 24px rgba(120, 20, 40, 0.12);
}

.achieve-card--hell .achieve-card__title,
.achieve-card--hell-glow .achieve-card__title {
    background: linear-gradient(105deg, #ff9a8b, #ff6a6a, #c9184a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.achieve-card--hell .achieve-progress--full .achieve-progress__fill,
.achieve-card--hell-glow .achieve-progress--full .achieve-progress__fill {
    background: linear-gradient(90deg, #5c1010, #ff4d6d, #ff758f, #ff4d6d, #5c1010);
    background-size: 200% 100%;
}

.achieve-tab--hell {
    border-color: rgba(220, 80, 100, 0.5);
    color: #ffb3c1;
}

.achieve-tab--hell.is-active {
    background: linear-gradient(135deg, rgba(120, 20, 40, 0.7), rgba(80, 10, 60, 0.65));
    border-color: rgba(255, 100, 120, 0.75);
    box-shadow: 0 0 16px rgba(220, 60, 80, 0.4);
}

.achieve-card.is-claimable {
    border-color: rgba(180, 120, 255, 0.65);
    box-shadow: 0 0 28px rgba(140, 80, 255, 0.25);
}

.achieve-card.is-claimed {
    opacity: 0.72;
    border-color: rgba(80, 200, 120, 0.35);
}

.achieve-card__head {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    text-align: center;
}

.achieve-card__badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(100, 60, 180, 0.4);
    color: #d4b8ff;
    border: 1px solid rgba(180, 140, 255, 0.3);
}

.achieve-card__title {
    margin: 0;
    font-size: 1rem;
    color: #f5ecd4;
    width: 100%;
}

.achieve-card__desc {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.62);
    text-align: center;
}

.achieve-progress {
    margin-bottom: 0.75rem;
}

.achieve-progress__track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.achieve-progress__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5a2d8a, #9b59d4);
    transition: width 0.45s ease;
    position: relative;
    z-index: 1;
}

.achieve-progress--full .achieve-progress__fill {
    background: linear-gradient(
        90deg,
        #8b6914,
        #f5d78e,
        #c9a227,
        #f5d78e,
        #8b6914
    );
    background-size: 200% 100%;
    animation: achieve-bar-flow 2.2s linear infinite;
}

.achieve-progress--full .achieve-progress__glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(200, 150, 255, 0.55),
        rgba(245, 215, 142, 0.7),
        rgba(200, 150, 255, 0.55),
        transparent
    );
    background-size: 200% 100%;
    animation: achieve-bar-glow 1.8s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes achieve-bar-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes achieve-bar-glow {
    0%,
    100% {
        background-position: 0% 50%;
        opacity: 0.5;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
}

.achieve-progress__text {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    font-family: Orbitron, monospace;
    color: rgba(212, 175, 55, 0.9);
    text-align: center;
}

.achieve-card__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.achieve-reward {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    flex-shrink: 0;
    min-width: min-content;
}

.achieve-reward .void-coin-icon {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
}

.achieve-reward > span {
    flex-shrink: 0;
    white-space: nowrap;
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    letter-spacing: 0.02em;
}

.achieve-card__status {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

/* .achieve-claim-btn 樣式見 css/void-claim-reward.css */

#achieve-toast {
    position: fixed;
    bottom: 28px;
    left: 24px;
    z-index: 320;
    max-width: min(360px, calc(100vw - 48px));
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(8, 4, 18, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #f5ecd4;
    font-size: 0.88rem;
    line-height: 1.4;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.35s, transform 0.35s;
    pointer-events: none;
}

#achieve-toast.show {
    opacity: 1;
    transform: translateX(0);
}

#achieve-toast.achieve-toast--secret {
    border-color: rgba(180, 100, 255, 0.7);
    box-shadow:
        0 0 24px rgba(140, 80, 255, 0.4),
        inset 0 0 20px rgba(120, 60, 200, 0.15);
    background: linear-gradient(135deg, rgba(20, 8, 40, 0.95), rgba(40, 20, 10, 0.92));
}

@media (max-width: 720px) {
    .achieve-view {
        width: 100%;
        max-width: 100%;
        margin-inline: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        box-sizing: border-box;
    }

    .achieve-hero {
        width: 100%;
    }

    .achieve-panel {
        width: 100%;
        max-width: min(100%, 560px);
        margin-inline: auto;
        box-sizing: border-box;
    }

    .achieve-grid-scroll {
        width: 100%;
    }

    .achieve-grid {
        width: 100%;
        justify-items: stretch;
    }
}

@media (max-width: 600px) {
    .achieve-grid {
        grid-template-columns: 1fr;
    }

    /* 可領取：獎勵與按鈕分兩行，避免按鈕擠壓貨幣圖示 */
    .achieve-card__foot:has(.achieve-claim-btn) {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .achieve-card__foot:has(.achieve-claim-btn) .achieve-reward {
        width: 100%;
        justify-content: center;
        font-size: 0.86rem;
        gap: 0.55rem 0.85rem;
    }

    .achieve-card__foot:has(.achieve-claim-btn) .achieve-reward .void-coin-icon {
        width: 1.5rem;
        height: 1.5rem;
    }

    .achieve-card__foot:has(.achieve-claim-btn) .achieve-claim-btn {
        width: 100%;
        max-width: 100%;
        padding: 0.55rem 1rem;
        font-size: 0.82rem;
    }

    .achieve-card__foot:not(:has(.achieve-claim-btn)) {
        justify-content: center;
    }

    #achieve-toast {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}

/* 側欄 · 可領取成就獎勵提示 */
.nav-btn[data-view='achieve'] {
    position: relative;
}

.nav-achieve-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
    color: #1a1000;
    background: linear-gradient(180deg, #ffe066 0%, #ffb020 100%);
    box-shadow: 0 0 10px rgba(255, 176, 32, 0.75);
    pointer-events: none;
}
