/* ==================================================
   PROGRESS TAB (gamification.js)
   Same metal plates as the Overview; each mission and milestone carries
   its area's accent. Done is green, never red: red is reserved for alerts,
   and nothing here is a failure state.
   ================================================== */

.gm-deck,
.gm-below {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s-4);
    align-items: start;
}

.gm-plate {
    display: grid;
    gap: var(--s-3);
    min-width: 0;
    padding: var(--s-4) var(--s-5) var(--s-5);
    border: 1px solid var(--metal-edge);
    border-radius: 4px;
    background: var(--metal-brush), var(--metal-face);
    box-shadow: var(--metal-bevel), var(--metal-drop);
}

.gm-plate__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-1) var(--s-3);
}

.gm-title {
    margin: 0;
    font-size: var(--fs-lg);
    letter-spacing: 0.04em;
}

.gm-count {
    color: var(--steel);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
}

.gm-lead,
.gm-hint,
.gm-empty {
    margin: 0;
    color: var(--steel);
    font-size: var(--fs-xs);
    line-height: 1.5;
}

.gm-empty {
    font-size: var(--fs-sm);
}

/* ---- Area accents (scoped so they win over the base rows below) ---- */

.gm-plate .gm-mission--pantheon { --area: var(--area-pantheon); }
.gm-plate .gm-mission--lyceum { --area: var(--area-lyceum); }
.gm-plate .gm-mission--forge { --area: var(--area-forge); }
.gm-plate .gm-mission--desert { --area: var(--area-desert); }
.gm-plate .gm-mission--trench { --area: var(--area-trench); }
.gm-plate .gm-mission--treasury { --area: var(--area-treasury); }

/* ---- Bars ---- */

.gm-bar {
    height: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: var(--metal-track);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.gm-bar__fill {
    display: block;
    height: 100%;
    background: var(--area, var(--steel));
    transition: width 0.4s ease;
}

.gm-bar--done .gm-bar__fill {
    background: var(--ok);
}

/* ---- Missions ---- */

.gm-mission-list,
.gm-cycle-list,
.gm-milestone-list {
    display: grid;
    gap: var(--s-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.gm-mission,
.gm-milestone {
    --area: var(--steel);
    display: grid;
    gap: var(--s-1);
    padding: var(--s-3);
    border: 1px solid var(--metal-edge);
    border-left: 3px solid var(--area);
    border-radius: 4px;
    background: var(--metal-face-sunken);
}

.gm-mission--done {
    border-left-color: var(--ok);
}

.gm-mission__top,
.gm-milestone__top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-1) var(--s-2);
}

.gm-mission__name,
.gm-milestone__name {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.gm-mission__state {
    color: var(--steel);
    font-family: var(--font-display);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gm-mission--done .gm-mission__state {
    color: var(--ok);
}

.gm-mission__text,
.gm-milestone__text {
    color: var(--steel);
    font-size: var(--fs-xs);
    line-height: 1.4;
}

/* ---- Cycle ---- */

.gm-cycle-row {
    --area: var(--steel);
    display: grid;
    grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-3);
    font-size: var(--fs-sm);
}

.gm-cycle-row__value {
    color: var(--steel);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    white-space: nowrap;
}

.gm-days {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 44px;
    padding: var(--s-1);
    border-radius: 3px;
    background: var(--metal-track);
}

.gm-day {
    position: relative;
    flex: 1 1 0;
    min-width: 2px;
    height: 100%;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.04);
}

.gm-day::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--fill, 0%);
    border-radius: 1px;
    background: var(--ok);
}

/* ---- Activity history ---- */

.gm-heat {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 2px;
}

.gm-heat__cell {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.gm-heat__cell--1 { background: rgba(92, 201, 124, 0.35); }
.gm-heat__cell--2 { background: rgba(92, 201, 124, 0.65); }
.gm-heat__cell--3 { background: var(--ok); }

.gm-heat__cell--today {
    box-shadow: inset 0 0 0 1px var(--bone);
}

.gm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1) var(--s-3);
    color: var(--steel);
    font-size: var(--fs-2xs);
}

.gm-legend__item {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
}

.gm-legend .gm-heat__cell {
    width: 10px;
    height: 10px;
}

/* ---- Milestones ---- */

.gm-milestone__total {
    font-family: var(--font-display-tight);
    font-size: var(--fs-md);
    font-variant-numeric: tabular-nums;
}

.gm-tiers {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1);
}

.gm-tier {
    padding: 2px 8px;
    border: 1px solid var(--metal-edge);
    border-radius: 3px;
    color: var(--steel-dim);
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
}

.gm-tier--on {
    border-color: var(--area);
    background: var(--metal-face-raised);
    color: var(--bone);
}

/* ---- Day plate line ---- */

.gm-line .hud-day__cycle-label {
    color: var(--area-desert);
}

/* ---- Feedback toast ---- */

.gm-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    display: grid;
    gap: var(--s-1);
    max-width: min(380px, calc(100vw - 32px));
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--metal-edge);
    border-left: 3px solid var(--ok);
    border-radius: 4px;
    background: var(--metal-brush), var(--metal-face-raised);
    box-shadow: var(--metal-bevel), var(--metal-drop);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gm-toast--show {
    opacity: 1;
    transform: none;
}

.gm-toast__line {
    margin: 0;
    font-size: var(--fs-sm);
}

@media (prefers-reduced-motion: reduce) {
    .gm-bar__fill,
    .gm-toast {
        transition: none;
    }
}

@media (max-width: 900px) {
    .gm-deck,
    .gm-below {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .gm-plate {
        padding: var(--s-4);
    }

    .gm-cycle-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .gm-cycle-row .gm-bar {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .gm-heat__cell {
        width: 11px;
        height: 11px;
    }

    .hud-tab {
        padding-right: var(--s-1);
        padding-left: var(--s-1);
        font-size: var(--fs-xs);
    }
}
