/**
 * Shared UI blocks (quests events, achievements cards) — always loaded on v2 pages.
 */

/* —— Quest events —— */
.jb-ev-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.jb-ev-section {
    padding: 18px 20px !important;
    border: 1px solid rgba(251, 191, 36, 0.2) !important;
}

.jb-ev-section__title {
    margin: 0 0 14px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.jb-ev-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 8px;
}

.jb-ev-row:last-child {
    margin-bottom: 0;
}

.jb-ev-row.is-ready {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.08);
}

.jb-ev-row.is-done {
    opacity: 0.7;
}

.jb-ev-row__main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.jb-ev-row__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    flex-shrink: 0;
    font-size: 1rem;
}

.jb-ev-row__name {
    font-weight: 700;
    color: #fff;
    font-size: 0.92rem;
    line-height: 1.25;
}

.jb-ev-row__reward,
.jb-ev-row__sub {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
}

.jb-ev-row__reward {
    color: #fbbf24;
    margin-top: 2px;
}

.jb-ev-row__progress {
    flex: 1;
    min-width: 120px;
    max-width: 280px;
}

.jb-ev-row__bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
    margin-bottom: 4px;
}

.jb-ev-row__bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3498db, #5dade2);
}

.jb-ev-row.is-ready .jb-ev-row__bar-fill {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.jb-ev-row__nums {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    font-family: 'JetBrains Mono', monospace;
}

.jb-ev-row__status {
    flex-shrink: 0;
    text-align: right;
}

.jb-ev-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.jb-ev-badge--ok {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

/* —— Achievement cards —— */
.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.ach-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 14px 14px;
    border-radius: 16px;
    background: rgba(8, 8, 14, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.ach-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: var(--tier, #fbbf24);
    opacity: 0.85;
}

.ach-card.is-owned {
    border-color: color-mix(in srgb, var(--tier, #fbbf24) 50%, transparent);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 20px color-mix(in srgb, var(--tier, #fbbf24) 15%, transparent);
}

.ach-card.is-owned::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--tier, #fbbf24) 18%, transparent), transparent 55%);
}

.ach-card.is-locked {
    opacity: 0.55;
    filter: grayscale(0.35);
}

.ach-card:hover {
    transform: translateY(-3px);
}

.ach-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 10px;
    background: color-mix(in srgb, var(--tier, #fbbf24) 18%, rgba(0, 0, 0, 0.5));
    color: var(--tier, #fbbf24);
    border: 2px solid color-mix(in srgb, var(--tier, #fbbf24) 45%, transparent);
    position: relative;
    z-index: 1;
}

.ach-card__tier {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tier, #fbbf24);
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.ach-card__name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.ach-card__desc {
    margin: 8px 0 0;
    font-size: 0.72rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.62);
    position: relative;
    z-index: 1;
    max-width: 22ch;
}

.ach-card.is-locked .ach-card__desc {
    color: rgba(255, 255, 255, 0.5);
}

.ach-card__hint {
    display: block;
    margin-top: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.55);
    position: relative;
    z-index: 1;
}

.ach-card__date {
    margin-top: 6px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    position: relative;
    z-index: 1;
}

.ach-card__lock {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 520px) {
    .ach-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .jb-ev-row {
        flex-direction: column;
        align-items: stretch;
    }

    .jb-ev-row__progress {
        max-width: none;
    }

    .jb-ev-row__status {
        text-align: left;
    }
}
