/* 웹툰 뷰어 하단 — 웰컴기프트 누적 시청 미션 (Figma 4케이스) */
.view-mission-section {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    box-sizing: border-box;
}

.view-mission-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── 미션 카드 공통 ── */
.view-mission-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 21px 15px;
    background: rgba(255, 82, 126, 0.03);
    box-sizing: border-box;
}

.view-mission-card__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.view-mission-card__message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.view-mission-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 100px;
    background: #fff;
    overflow: hidden;
}

.view-mission-card__icon img {
    width: 70px;
    height: 76px;
    object-fit: contain;
    display: block;
}

.view-mission-card__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 20px;
    color: #434343;
    white-space: nowrap;
}

.view-mission-card__title-accent {
    color: #ff527e;
}

.view-mission-card__desc {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    color: #434343;
}

/* ── 프로그레스 영역 ── */
.view-mission-card__progress {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 344px;
    height: 102px;
}

.view-mission-card__gift-wrap {
    position: relative;
    width: 100%;
    max-width: 313px;
    height: 46px;
}

.view-mission-card__gift {
    position: absolute;
    top: 4px;
    width: 35px;
    height: 41px;
    transform: translateX(-50%);
    object-fit: contain;
    display: block;
}

.view-mission-card__gift-btn {
    position: absolute;
    top: 4px;
    width: 35px;
    height: 41px;
    transform: translateX(-50%);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.view-mission-card__gift-btn .view-mission-card__gift {
    position: static;
    transform: none;
    width: 100%;
    height: 100%;
}

/* 마일스톤 위치 — 10/20/30/40화 구간 끝 (25% · 50% · 75% · 100%) */
.view-mission-card__gift-wrap--step1 .view-mission-card__gift,
.view-mission-card__gift-wrap--step1 .view-mission-card__gift-btn { left: 25%; }
.view-mission-card__gift-wrap--step2 .view-mission-card__gift,
.view-mission-card__gift-wrap--step2 .view-mission-card__gift-btn { left: 50%; }
.view-mission-card__gift-wrap--step3 .view-mission-card__gift,
.view-mission-card__gift-wrap--step3 .view-mission-card__gift-btn { left: 75%; }
.view-mission-card__gift-wrap--step4 .view-mission-card__gift,
.view-mission-card__gift-wrap--step4 .view-mission-card__gift-btn { left: 100%; }

.view-mission-card__track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 313px;
    height: 15px;
    padding: 0;
    border: 0.5px solid #434343;
    border-radius: 50px;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.view-mission-card__seg {
    position: relative;
    height: 100%;
    background: #fff;
    overflow: hidden;
}

.view-mission-card__seg::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #ff527e;
}

.view-mission-card__seg--tint {
    background: rgba(255, 82, 126, 0.2);
}

.view-mission-card__seg--full::after {
    width: 100%;
}

.view-mission-card__seg--partial::after {
    width: var(--progress-fill, 70%);
}

/* 케이스1 — 조건 미달: 1구간 연핑크 + 현재 진행만큼 진핑크 */
.view-mission-card--shortfall .view-mission-card__seg:nth-child(1) {
    background: rgba(255, 82, 126, 0.2);
}

.view-mission-card--shortfall .view-mission-card__seg:nth-child(1)::after {
    width: var(--progress-fill, 70%);
}

.view-mission-card--shortfall .view-mission-card__gift {
    width: 35px;
    height: 41px;
}

/* 케이스2 — 조건 달성: 1구간 완료 */
.view-mission-card--achieved .view-mission-card__seg:nth-child(1)::after {
    width: 100%;
}

/* 케이스3 — 코인 수령 이후: 1구간 완료 + 2구간 tint */
.view-mission-card--after-reward .view-mission-card__seg:nth-child(1)::after {
    width: 100%;
}

.view-mission-card--after-reward .view-mission-card__seg:nth-child(2) {
    background: rgba(255, 82, 126, 0.2);
}

.view-mission-card--after-reward .view-mission-card__gift {
    width: 35px;
    height: 41px;
}

/* 케이스4 — 최종 달성: 전 구간 완료 */
.view-mission-card--all-clear .view-mission-card__seg::after {
    width: 100%;
}

/* ── 마일스톤 라벨 (틱 = 구간 끝, 40화 = 바 끝) ── */
.view-mission-card__labels {
    position: relative;
    width: 100%;
    max-width: 313px;
    height: 21px;
    margin: 0;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
}

.view-mission-card__labels li {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    font-size: 13px;
    font-weight: 500;
    line-height: normal;
    color: #000;
    text-align: center;
    white-space: nowrap;
}

.view-mission-card__labels li:nth-child(1) { left: 25%; }
.view-mission-card__labels li:nth-child(2) { left: 50%; }
.view-mission-card__labels li:nth-child(3) { left: 75%; }
.view-mission-card__labels li:nth-child(4) {
    left: 100%;
    transform: translateX(-50%);
}

.view-mission-card__labels li::before {
    content: "";
    display: block;
    width: 1px;
    height: 5px;
    background: #434343;
}

@media (min-width: 959px) {
    .view-mission-section {
        padding: 0 0 32px;
    }

    .view-mission-card {
        padding: 24px 35px;
    }
}

/* ── UI 확인용 임시 버튼 ── */
.view-mission-dev {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 15px 24px;
    box-sizing: border-box;
}

.view-mission-dev__btn {
    width: 100%;
    padding: 12px 16px;
    border: 1px dashed #ff527e;
    border-radius: 8px;
    background: #fff;
    color: #ff527e;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.view-mission-dev__btn:active {
    background: rgba(255, 82, 126, 0.06);
}

/* ── 웰컴기프트 팝업 공통 ── */
.view-mission-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.view-mission-popup.is-open {
    display: flex;
}

.view-mission-popup__dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.view-mission-popup__box {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border-radius: 6px;
    box-shadow:
        0 16px 16px rgba(12, 12, 13, 0.1),
        0 4px 2px rgba(12, 12, 13, 0.05);
}

/* 팝업1 — 웰컴 기프트 코인 지급 (Figma 2945:308) */
.view-mission-popup__box--type1 {
    max-width: 240px;
    gap: 10px;
    padding: 20px 15px;
}

.view-mission-popup__label {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: -0.55px;
    color: #434343;
    text-align: center;
}

.view-mission-popup__message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 173px;
    text-align: center;
}

.view-mission-popup__message p {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    color: #434343;
}

.view-mission-popup__message p.view-mission-popup__coin {
    font-size: 18px;
    color: #ff527e;
}

.view-mission-popup__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 173px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: #ff527e;
    box-shadow: 1px 1px 1px rgba(5, 145, 255, 0.1);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: 0.15px;
    cursor: pointer;
}

/* 팝업2 — 미션 클리어 (Figma 2946:320) */
.view-mission-popup__box--type2 {
    position: relative;
    max-width: 336px;
    min-height: 299px;
    gap: 10px;
    padding: 20px 15px;
    overflow: hidden;
}

.view-mission-popup__box-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 6px;
    overflow: hidden;
    pointer-events: none;
}

.view-mission-popup__box-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.view-mission-popup__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.view-mission-popup__body--compact {
    gap: 10px;
}

.view-mission-popup__title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 30px;
    letter-spacing: -0.55px;
    color: #434343;
    text-align: center;
}

.view-mission-popup__coin-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 186px;
    padding: 0 12px;
    border: 1px solid #ff527e;
    border-radius: 50px;
    box-sizing: border-box;
}

.view-mission-popup__coin-badge p {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 30px;
    letter-spacing: -0.55px;
    color: #ff527e;
    text-align: center;
    white-space: nowrap;
}

.view-mission-popup__sub {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 16px;
    letter-spacing: -0.55px;
    color: #434343;
    text-align: center;
}

.view-mission-popup__btn--wide {
    max-width: 214px;
    height: 40px;
    font-size: 18px;
}
