.hidden {
    display: none !important;
}

.achievements-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2rem;
}

.ach-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--card-grad);
    border: 1px solid var(--card-border-strong);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.ach-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ach-header-icon {
    flex: none;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #0d9488, #115e59);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    color: #fff;
}

.ach-header-icon svg {
    width: 26px;
    height: 26px;
}

.ach-header-text {
    flex: 1;
    min-width: 0;
}

.ach-header-text h1 {
    font-size: 1.6rem;
    font-weight: 900;
}

.ach-header-text p {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.ach-progress {
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.ach-progress.small {
    height: 6px;
    flex: 1;
}

.ach-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary-grad);
}

.ach-card .ach-progress i {
    background: var(--tone-a);
}

.ach-claim-all,
.ach-claim {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    border-bottom: 3px solid #991b1b;
    border-radius: 12px;
    background: var(--primary-grad);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.ach-claim-all {
    flex: none;
    padding: 0.7rem 1.1rem;
}

.ach-claim-all svg {
    width: 18px;
    height: 18px;
}

.ach-claim {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.ach-claim-all:hover,
.ach-claim:hover {
    filter: brightness(1.08);
}

.ach-claim-all:active,
.ach-claim:active {
    transform: translateY(2px);
    border-bottom-width: 0;
}

.ach-claim-all .shine,
.ach-claim .shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-200%) skewX(-25deg);
    pointer-events: none;
}

.ach-claim-all:hover .shine,
.ach-claim:hover .shine {
    animation: shine 0.8s forwards;
}

.ach-claim-all:disabled .shine,
.ach-claim:disabled .shine {
    display: none;
}

.ach-claim-all:disabled,
.ach-claim:disabled {
    cursor: wait;
    opacity: 0.6;
}

.ach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border: 1px solid var(--card-border-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.ach-btn:hover {
    border-color: var(--card-border-hover);
    color: var(--text-main);
}

.ach-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ach-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--card-border-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.ach-filter:hover {
    border-color: var(--card-border-hover);
    color: var(--text-main);
}

.ach-filter.active {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-main);
}

.ach-filter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.ach-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ach-section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.ach-section-title h2 {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ach-section-title span {
    color: var(--text-faint);
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ach-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.ach-card,
.ach-icon {
    --tone-a: #ea580c;
    --tone-b: #9a3412;
}

.ach-card.tone-orange, .ach-icon.tone-orange { --tone-a: #ea580c; --tone-b: #9a3412; }
.ach-card.tone-purple, .ach-icon.tone-purple { --tone-a: #9333ea; --tone-b: #6b21a8; }
.ach-card.tone-yellow, .ach-icon.tone-yellow { --tone-a: #ca8a04; --tone-b: #854d0e; }
.ach-card.tone-green,  .ach-icon.tone-green  { --tone-a: #16a34a; --tone-b: #166534; }
.ach-card.tone-sky,    .ach-icon.tone-sky    { --tone-a: #0284c7; --tone-b: #1e40af; }
.ach-card.tone-teal,   .ach-icon.tone-teal   { --tone-a: #0d9488; --tone-b: #115e59; }
.ach-card.tone-pink,   .ach-icon.tone-pink   { --tone-a: #db2777; --tone-b: #9d174d; }

.ach-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: var(--card-grad);
    border: 1px solid var(--card-border-strong);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
}

.ach-card.is-claimable {
    border-color: var(--card-border-hover);
}

.ach-icon {
    flex: none;
    align-self: flex-start;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    color: #fff;
}

.ach-icon svg {
    width: 22px;
    height: 22px;
}

.ach-card.is-locked .ach-icon {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    color: var(--text-faint);
}

.ach-card.is-locked .ach-progress i {
    background: rgba(255, 255, 255, 0.35);
}

.ach-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ach-title {
    font-size: 1rem;
    font-weight: 700;
}

.ach-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.ach-progress-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.ach-progress-text {
    flex: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ach-reward {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.ach-reward svg {
    width: 14px;
    height: 14px;
}

.ach-card.is-claimable .ach-reward {
    color: var(--text-soft);
}

.ach-card.is-claimed .ach-reward {
    color: var(--text-faint);
}

.ach-action {
    flex: none;
}

.ach-state {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-faint);
    font-size: 0.85rem;
    font-weight: 700;
}

.ach-state svg {
    width: 18px;
    height: 18px;
}

.ach-card-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: translateX(-120%) skewX(-20deg);
    pointer-events: none;
}

.ach-fx {
    position: fixed;
    inset: 0;
    z-index: 3500;
    pointer-events: none;
    overflow: hidden;
}

.ach-particle {
    position: absolute;
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 3px;
}

.ach-float {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: #141414;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    white-space: nowrap;
}

.ach-float.is-gold {
    color: #facc15;
}

.ach-flash {
    position: fixed;
    inset: 0;
    z-index: 4600;
    background: #fff;
    opacity: 0;
    pointer-events: none;
}

.ach-celebrate {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.92);
    text-align: center;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-user-select: none;
    user-select: none;
    animation: ach-fade-in 0.3s ease-out;
}

.ach-celebrate > * {
    flex-shrink: 0;
}

.ach-celebrate > :first-child {
    margin-top: auto;
}

.ach-celebrate > :last-child {
    margin-bottom: auto;
}

@keyframes ach-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ach-celebrate-stage {
    --rays: min(600px, 140vw);
    position: relative;
    width: 100%;
    height: 170px;
    display: grid;
    place-items: center;
}

.ach-celebrate-light {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(420px, 92vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #facc15 0%, transparent 62%);
    opacity: 0.18;
    transform: translate(-50%, -50%) scale(0.7);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
}

.ach-celebrate.is-done .ach-celebrate-light {
    opacity: 0.45;
    transform: translate(-50%, -50%) scale(1.1);
}

.ach-celebrate-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--rays);
    height: var(--rays);
    margin: calc(var(--rays) / -2) 0 0 calc(var(--rays) / -2);
    background: repeating-conic-gradient(from 0deg, transparent 0deg 9deg, rgba(255, 255, 255, 0.09) 9deg 18deg);
    -webkit-mask-image: radial-gradient(circle, #000 12%, transparent 62%);
    mask-image: radial-gradient(circle, #000 12%, transparent 62%);
    opacity: 0.35;
    transition: opacity 0.6s ease;
    animation: ach-rays-spin 14s linear infinite;
    pointer-events: none;
}

.ach-celebrate.is-done .ach-celebrate-rays {
    opacity: 1;
}

@keyframes ach-rays-spin {
    to { transform: rotate(360deg); }
}

.ach-celebrate-trophy {
    position: relative;
    font-size: 5.5rem;
    line-height: 1;
    animation: ach-trophy-wait 1.2s ease-in-out infinite;
}

.ach-celebrate.is-done .ach-celebrate-trophy {
    animation: ach-trophy-float 3s ease-in-out infinite;
}

@keyframes ach-trophy-wait {
    0%, 100% { transform: rotate(-6deg) scale(1); }
    50% { transform: rotate(6deg) scale(1.06); }
}

@keyframes ach-trophy-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.ach-celebrate-title {
    position: relative;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    font-weight: 900;
    line-height: 1.15;
}

.ach-celebrate-gold {
    position: relative;
    min-height: 1.6em;
    color: #facc15;
    font-size: 1.35rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.ach-celebrate-rewards {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    width: min(620px, 100%);
    min-height: 96px;
}

.ach-celebrate-tile {
    width: 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.7rem 0.4rem;
    border: 1px solid var(--card-border-strong);
    border-radius: 14px;
    background: #141414;
    opacity: 0;
}

.ach-celebrate-tile-icon {
    font-size: 1.9rem;
    line-height: 1;
}

.ach-celebrate-tile-label {
    max-width: 100%;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}

.ach-celebrate-tile.is-gold .ach-celebrate-tile-label {
    color: #facc15;
}

.ach-celebrate-close {
    position: relative;
    width: min(320px, 86vw);
    margin-top: 0.6rem;
    padding: 0.85rem 1rem;
    opacity: 0;
    pointer-events: none;
}

.ach-celebrate.is-done .ach-celebrate-close {
    pointer-events: auto;
}

.ach-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 2rem 1rem;
    border: 1px dashed var(--card-border-strong);
    border-radius: 20px;
    color: var(--text-muted);
    text-align: center;
}

.ach-toast {
    position: fixed;
    left: 50%;
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    z-index: 5000;
    transform: translateX(-50%);
    max-width: calc(100vw - 2rem);
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--card-border-strong);
    border-radius: 14px;
    background: #141414;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
    color: #fff;
    font-weight: 800;
    text-align: center;
    animation: ach-toast-in 0.2s ease-out;
}

.ach-toast.is-error {
    color: #fca5a5;
}

@keyframes ach-toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .ach-celebrate,
    .ach-celebrate-rays,
    .ach-celebrate-trophy,
    .ach-celebrate.is-done .ach-celebrate-trophy {
        animation: none;
    }
}

@media (max-width: 760px) {
    .ach-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .ach-header-row {
        flex-wrap: wrap;
    }

    .ach-claim-all {
        width: 100%;
    }

    .ach-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -1rem;
        padding: 0 1rem 0.25rem;
        scrollbar-width: none;
    }

    .ach-filters::-webkit-scrollbar {
        display: none;
    }

    .ach-card {
        flex-wrap: wrap;
    }

    .ach-action {
        width: 100%;
        padding-left: calc(44px + 1rem);
    }

    .ach-claim {
        width: 100%;
    }
}
