/* Quest cards reuse the Predictable card/grid classes; keep only quest state
   details here so this group stays visually in sync with Predictable. */
body.page-home #quest-cases-home .quest-home-card,
body.page-home #quest-cases-home .quest-home-card *,
body.page-home #quest-cases-home .quest-home-card::before,
body.page-home #quest-cases-home .quest-home-card::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.page-home .quest-cases-home-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
}

/* Four cards per row on PC; flex centering centers any incomplete final row. */
body.page-home #quest-cases-home .quest-cases-home-grid > .quest-home-card {
    flex: 0 0 calc((100% - (var(--quest-columns, 4) - 1) * 20px) / var(--quest-columns, 4)) !important;
    width: calc((100% - (var(--quest-columns, 4) - 1) * 20px) / var(--quest-columns, 4)) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    border-color: color-mix(in srgb, var(--quest-stage-color, #22c55e) 78%, transparent) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .2), 0 0 8px color-mix(in srgb, var(--quest-stage-color, #22c55e) 18%, transparent) !important;
}

body.page-home #quest-cases-home [data-quest-stage-day="1"] { --quest-stage-color: #22c55e; }
body.page-home #quest-cases-home [data-quest-stage-day="2"] { --quest-stage-color: #84cc16; }
body.page-home #quest-cases-home [data-quest-stage-day="3"] { --quest-stage-color: #06b6d4; }
body.page-home #quest-cases-home [data-quest-stage-day="4"] { --quest-stage-color: #3b82f6; }
body.page-home #quest-cases-home [data-quest-stage-day="5"] { --quest-stage-color: #8b5cf6; }
body.page-home #quest-cases-home [data-quest-stage-day="6"] { --quest-stage-color: #f97316; }
body.page-home #quest-cases-home [data-quest-stage-day="7"] { --quest-stage-color: #ef4444; }

body.page-home #quest-cases-home .quest-home-card__day {
    display: block;
    margin: 0 auto 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

body.page-home #quest-cases-home .quest-home-card:hover {
    border-color: var(--quest-stage-color, #22c55e) !important;
    box-shadow: 0 6px 15px color-mix(in srgb, var(--quest-stage-color, #22c55e) 24%, transparent), 0 0 8px color-mix(in srgb, var(--quest-stage-color, #22c55e) 22%, transparent) inset !important;
}

body.page-home .quest-home-progress-label {
    display: block;
    color: #22c55e !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    order: 2;
    margin-top: 1px;
}

body.page-home #quest-cases-home .quest-home-progress-track {
    order: 1;
    border-color: #22c55e !important;
    background: rgba(20, 83, 45, .72) !important;
    box-shadow: 0 0 7px rgba(34, 197, 94, .34) !important;
}

body.page-home #quest-cases-home .quest-home-progress-track .predictable-progress-fill {
    background: linear-gradient(90deg, #16a34a, #86efac) !important;
}

body.page-home #quest-cases-home .quest-home-card .case-image img {
    filter: drop-shadow(0 0 14px rgba(34, 197, 94, .35)) !important;
}

@media (min-width: 1025px) {
    body.page-home #quest-cases-home .quest-home-card .case-image img {
        transform: scale(1.26) !important;
        transform-origin: center center !important;
    }
}

/* Mobile/tablet case images should not get a clipped green halo. */
@media (max-width: 1024px) {
    body.page-home #quest-cases-home .quest-home-card .case-image img {
        filter: none !important;
    }
}

body.page-home #quest-cases-home .daily-free-home-price::before {
    background: linear-gradient(90deg, transparent, #22c55e 40%, #22c55e 60%, transparent) !important;
    box-shadow: 0 0 9px rgba(34, 197, 94, .45) !important;
}

body.page-home #quest-cases-home .daily-free-home-header .section-title::after {
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, .75), #22c55e, rgba(34, 197, 94, .75), transparent) !important;
    box-shadow: 0 0 10px rgba(34, 197, 94, .35) !important;
}

body.page-home #quest-cases-home .daily-free-home-header .section-title h2 {
    color: #22c55e !important;
    text-shadow: 0 0 12px rgba(34, 197, 94, .35) !important;
}

body.page-home #quest-cases-home .quest-home-timeline {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin: 20px 0 28px;
    padding: clamp(15px, 1.8vw, 22px);
    overflow: hidden;
    border: 1px solid rgba(126, 34, 206, .22);
    border-radius: 16px;
    background: linear-gradient(to right, rgba(38, 35, 78, .7), rgba(23, 19, 61, .7));
    box-shadow: 0 5px 20px rgba(0, 0, 0, .3), 0 0 6px rgba(126, 34, 206, .5) inset;
    color: #fff;
}

body.page-home #quest-cases-home .quest-cases-home__description {
    display: block !important;
    max-width: 920px !important;
    margin: 4px auto 18px !important;
    padding: 0 16px;
    color: rgba(255, 255, 255, .92) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    text-align: center !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6) !important;
}

body.page-home #quest-cases-home .quest-cases-home__description [data-quest-restore-price] {
    color: #22c55e;
    font-weight: 800;
    white-space: nowrap;
}

body.page-home #quest-cases-home .quest-home-timeline::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    border-radius: 16px;
    background: linear-gradient(90deg, rgba(126, 34, 206, 0) 60%, rgba(126, 34, 206, .14) 100%);
    pointer-events: none;
}

body.page-home #quest-cases-home .quest-home-timeline__case-art {
    position: absolute;
    z-index: 0;
    top: 50%;
    right: -205px;
    width: 540px;
    height: 356px;
    object-fit: contain;
    opacity: .24;
    filter: blur(2px);
    pointer-events: none;
    transform: translateY(-50%);
}

body.page-home #quest-cases-home .quest-home-timeline > *:not(.quest-home-timeline__case-art) {
    position: relative;
    z-index: 1;
}

body.page-home #quest-cases-home .quest-home-timeline__summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    color: #cbd5e1;
    font-size: clamp(13px, 1.2vw, 17px);
    font-weight: 600;
}

body.page-home #quest-cases-home .quest-home-timeline__summary strong {
    color: #22c55e;
}

body.page-home #quest-cases-home .quest-home-timeline__current-case {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

body.page-home #quest-cases-home .quest-home-timeline__track {
    position: relative;
    height: 6px;
    margin: 0 9px;
    border: 0;
    border-radius: 5px;
    background: linear-gradient(to right, rgba(79, 17, 147, .6), rgba(126, 34, 206, .8));
    box-shadow: none;
    overflow: visible;
}

body.page-home #quest-cases-home .quest-home-timeline__fill {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 4px;
    border-radius: inherit;
    background: rgba(255, 255, 255, .16);
    box-shadow: none;
    transition: width .35s ease;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone {
    position: absolute;
    z-index: 1;
    top: 50%;
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, .58);
    border-radius: 50%;
    background: #24133b;
    transform: translate(-50%, -50%);
}

body.page-home #quest-cases-home .quest-home-timeline__milestone.is-reached {
    border-color: rgba(255, 255, 255, .8);
    background: #9333ea;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone.is-current {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, .88);
    background: #a855f7;
    box-shadow: 0 0 8px rgba(126, 34, 206, .5);
}

body.page-home #quest-cases-home .quest-home-timeline__today {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: none;
    transform: translate(-50%, -50%);
    transition: left .35s ease;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone-labels {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 34px;
    padding: 2px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #9ba7b8;
    text-align: center;
    font-size: 14px;
    line-height: 1.25;
    transition: color .2s ease;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone-label b {
    color: inherit;
    font-size: 16px;
    font-weight: 700;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone-label small {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    white-space: normal;
    overflow-wrap: anywhere;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone-label small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone-label.is-reached,
body.page-home #quest-cases-home .quest-home-timeline__milestone-label.is-current {
    color: #fff;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone-label.is-current {
    color: #fff;
    font-weight: 700;
}

body.page-home #quest-cases-home .quest-home-timeline__milestone-label.is-reached:not(.is-current) {
    color: #c4b5d8;
}

body.page-home .quest-home-card--unavailable {
    filter: grayscale(1);
    opacity: .55;
}

body.page-home #quest-cases-home .quest-home-card--current {
    filter: none !important;
    opacity: 1 !important;
}

@media (min-width: 1201px) {
    body.page-home #quest-cases-home .quest-home-timeline__track {
        margin-inline: 54px;
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-labels {
        position: relative;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
        margin: 16px 54px 0;
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-label {
        position: relative;
        min-width: 0;
        padding-inline: 0;
        box-sizing: border-box;
        align-items: center;
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-label b {
        white-space: nowrap;
        font-size: clamp(13px, 1vw, 16px);
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-label small {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        font-size: clamp(11px, .85vw, 13px);
    }
}

@media (max-width: 1200px) {
    body.page-home #quest-cases-home .quest-cases-home-grid {
        gap: 15px !important;
    }

    body.page-home #quest-cases-home .quest-cases-home-grid > .quest-home-card {
        flex-basis: calc((100% - 30px) / 3) !important;
        width: calc((100% - 30px) / 3) !important;
    }

    body.page-home .quest-home-progress-label {
        font-size: clamp(10px, 3.2cqw, 12px);
    }

    body.page-home .quest-home-progress-track {
        display: none !important;
    }
}

@media (max-width: 768px) {
    body.page-home #quest-cases-home .quest-cases-home-grid {
        gap: 10px !important;
    }

    body.page-home #quest-cases-home .quest-cases-home-grid > .quest-home-card {
        flex-basis: calc((100% - 10px) / 2) !important;
        width: calc((100% - 10px) / 2) !important;
    }

    body.page-home #quest-cases-home .quest-home-timeline {
        margin-top: 16px;
        margin-bottom: 22px;
        padding: 14px 12px;
    border-radius: 16px;
    }

    body.page-home #quest-cases-home .quest-cases-home__description {
        width: 100%;
        max-width: 100% !important;
        margin: 2px auto 12px !important;
        padding: 0 10px;
        box-sizing: border-box;
        font-size: clamp(12px, 3.7vw, 14px) !important;
        line-height: 1.42 !important;
        text-wrap: pretty;
    }

    body.page-home #quest-cases-home .quest-home-timeline__summary {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 15px;
        font-size: 11px;
    }

    body.page-home #quest-cases-home .quest-home-timeline__current-case {
        justify-content: flex-end;
        max-width: 72%;
        text-align: right;
    }

    body.page-home #quest-cases-home .quest-home-timeline__case-art {
        display: none;
    }

    body.page-home #quest-cases-home .quest-home-timeline__track {
        height: 5px;
        margin: 0 7px;
        background: rgba(15, 23, 42, .58);
        border: 1px solid rgba(168, 85, 247, .55);
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone {
        width: 8px;
        height: 8px;
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-labels {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 2px;
        overflow: visible;
        padding: 0;
        margin-top: 12px;
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-label {
        display: flex;
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 3px 1px 7px;
        box-sizing: border-box;
        transform: none;
        align-items: center;
        border: 0;
        border-radius: 0;
        background: transparent;
        text-align: center;
        font-size: 12px;
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-label.is-current {
        color: #fff;
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-label.is-current::after {
        position: absolute;
        bottom: 1px;
        left: 50%;
        width: 24px;
        height: 2px;
        border-radius: 2px;
        background: #a855f7;
        content: "";
        transform: translateX(-50%);
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-label b {
        font-size: clamp(8px, 2.5vw, 11px);
        white-space: nowrap;
    }

    body.page-home #quest-cases-home .quest-home-timeline__milestone-label small {
        display: block;
        max-width: 100%;
        font-size: clamp(7px, 2vw, 9px);
        line-height: 1.15;
        white-space: normal;
    }
}

.quest-home-timeline__milestone-label .quest-home-infinity {
    display: inline-block;
    font-size: 1.6em;
    line-height: .65;
    vertical-align: -.08em;
}

@media (max-width: 400px) {
    body.page-home #quest-cases-home .quest-home-timeline {
        padding: 12px 10px;
    }

    body.page-home #quest-cases-home .quest-home-timeline__summary {
        margin-bottom: 14px;
    }

}
