/* ═══════════════════════════════════════════════════════════════
   MISSIONS (missions.php) — everything is mi-* scoped.
   Loaded after css/home.css (tokens, shared bits), css/gacha.css (item tiles) and css/seasons.css (the folds,
   the reward grid and the currency icons it reuses). A mission is one row: what to do on the left, what it pays
   on the right.
   ═══════════════════════════════════════════════════════════════ */

.mi-top { display: grid; gap: 4px; margin-top: 6px; }

/* ── Tabs + search: stick to the top of the window ── */
.mi-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -14px 0; padding: 9px 12px; border: 3px solid var(--ink); background: rgba(23, 25, 31, 0.96); box-shadow: 4px 4px 0 var(--ink); }
.mi-tabs { display: flex; flex: 1 1 auto; gap: 7px; min-width: 0; padding: 2px 4px !important; overflow-x: auto; scrollbar-width: thin; }
.mi-tabs li { flex: none; }
.mi-tabs a { display: block; padding: 8px 14px 7px; border: 2px solid var(--ink); background: var(--panel-2); font: 400 1rem/1 var(--font-head); letter-spacing: 0.04em; text-transform: uppercase; transform: skewX(-9deg); transition: background 0.12s, color 0.12s; }
.mi-tabs a span { display: inline-block; transform: skewX(9deg); }
.mi-tabs a i { margin-left: 4px; color: var(--dim); font-size: 0.78em; font-style: normal; font-variant-numeric: tabular-nums; }
.mi-tabs a:hover { background: #fff; color: var(--ink); }
.mi-tabs a.is-on { background: var(--yellow); color: var(--ink); }
.mi-tabs a.is-on i, .mi-tabs a:hover i { color: inherit; }
.mi-tabs a.is-empty { opacity: 0.45; }
.mi-search { flex: 1 1 220px; max-width: 340px; margin: 0; }
.mi-search[hidden] { display: none; }
.mi-search input { width: 100%; padding: 7px 10px; border: 2px solid var(--ink); background: var(--bg); color: var(--text); font: inherit; font-size: 0.92rem; }
.mi-search input:focus { outline: 2px solid var(--yellow); outline-offset: 0; }

.mi-panel { display: grid; gap: 16px; scroll-margin-top: 76px; }
.mi-panel > * { min-width: 0; }
.mi-panel[hidden], .mi-row[hidden], .mi-fold[hidden], .mi-none[hidden], .mi-hide { display: none; }
.mi-panel .hm-head { margin-bottom: 0; }
.mi-panel .se-h3 { margin: 6px 0 0; }
.mi-panel .se-h3 small { color: var(--dim); font-size: 0.8em; }
.mi-lead { margin-top: -8px !important; }
.mi-none { color: var(--dim); text-align: center; }

/* ── Star table (Daily / Weekly) ───────────────────────────────── */
.mi-track { display: grid; gap: 10px; padding: 12px 14px; border: 3px solid var(--ink); background: var(--panel); box-shadow: 4px 4px 0 var(--yellow); }
.mi-track p { color: var(--dim); font-size: 0.9rem; }
/* The game's star reward list: a dotted bar per step (orange for Daily, red for Weekly) with the stars the step
   costs and a pale reward box. The site has no Season License EXP icon, so the box prints the reward's name. */
.mi-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 214px), 1fr)); gap: 12px 10px; padding-bottom: 4px !important; }
.mi-steps li { --bar: #ff7a00; --dot: rgba(206, 78, 0, 0.55); position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 7px 7px 7px 12px; border-radius: 5px; background: var(--bar) radial-gradient(var(--dot) 34%, transparent 36%) 0 0 / 15px 15px; box-shadow: 3px 3px 0 var(--ink); }
.mi-steps-weekly li { --bar: #e8474a; --dot: rgba(176, 30, 40, 0.5); }
.mi-step-stars { color: #0b0b0d; font-size: 1.75rem; letter-spacing: 3px; line-height: 1; white-space: nowrap; text-shadow: 0 0 4px rgba(0, 0, 0, 0.45); }
.mi-step-rw { position: relative; display: grid; align-content: end; justify-items: end; gap: 1px; min-width: 96px; min-height: 54px; padding: 4px 8px 3px; border-radius: 5px; background: #d8d8d8 linear-gradient(135deg, rgba(255, 255, 255, 0.55) 25%, transparent 25% 50%, rgba(255, 255, 255, 0.55) 50% 75%, transparent 75%) 0 0 / 18px 18px; }
.mi-step-rw img { position: absolute; top: 50%; left: 50%; width: auto; height: 50px; transform: translate(-50%, -50%); }
.mi-step-rw b { position: relative; }
.mi-step-rw small { max-width: 100%; overflow: hidden; color: #1596b4; font: 400 0.62rem/1.15 var(--font-head); letter-spacing: 0.05em; text-align: right; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.mi-step-rw b { color: #fff; font: 400 1.25rem/1 var(--font-head); font-variant-numeric: tabular-nums; text-shadow: -1.5px -1.5px 0 #0b0b0d, 1.5px -1.5px 0 #0b0b0d, -1.5px 1.5px 0 #0b0b0d, 1.5px 1.5px 0 #0b0b0d, 0 2px 0 #0b0b0d; white-space: nowrap; }
.mi-steps i { position: absolute; left: 10px; bottom: -8px; padding: 0 7px; background: var(--ink); color: var(--yellow); font: 400 0.68rem/1.5 var(--font-head); font-style: normal; font-variant-numeric: tabular-nums; }

/* ── Mission rows ──────────────────────────────────────────────── */
.mi-list { display: grid; gap: 6px; }
.mi-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 8px 12px; border: 2px solid var(--ink); border-left: 5px solid var(--yellow); background: var(--panel); }
.mi-row.is-soon { border-left-color: var(--blue); }
.mi-main { display: grid; gap: 2px; min-width: 0; }
.mi-main p { font: 400 1rem/1.25 var(--font-head); overflow-wrap: anywhere; }
.mi-main small { color: var(--dim); font-size: 0.78rem; line-height: 1.3; }
.mi-main .mi-after { color: #8f95a3; }
.mi-main .mi-after::before { content: '\21B3  '; }
.mi-main .mi-when { color: var(--text); }
.mi-soon { display: inline-block; margin-right: 4px; padding: 1px 8px; background: var(--blue); color: #fff; font: 400 0.68rem/1.4 var(--font-head); font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; }
.mi-get { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; max-width: 760px; }
.mi-stars { color: #4a4f5c; font-size: 1.25rem; letter-spacing: 2px; line-height: 1; white-space: nowrap; }
.mi-stars i { color: var(--yellow); font-style: normal; text-shadow: 1px 1px 0 var(--ink); }
.mi-rw { display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 3px 9px 3px 4px; border: 2px solid var(--ink); background: var(--panel-2); font-size: 0.84rem; line-height: 1.2; }
a.mi-rw:hover { border-color: var(--yellow); }
.mi-rw .ga-tile, .mi-rw .se-cu { flex: none; width: 34px; }
.mi-rw .se-cu { background-color: transparent; background-size: contain; box-shadow: none; }
.mi-rw .ga-bg-other img, .se-rw .mi-exp img { padding: 4%; }
.mi-rw .mi-exp { background-color: transparent; }
.mi-rw .mi-exp::after { box-shadow: none; }
.mi-rw .ga-bg-plate { width: 96px !important; }
.mi-rw > span:not(.ga-tile) { display: grid; min-width: 0; }
.mi-rw b { font-weight: 400; overflow-wrap: anywhere; }
.mi-rw small { color: var(--dim); font-size: 0.72rem; }
.mi-rw em { color: var(--yellow); font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mi-rx { display: inline-block; padding: 2px 8px; border: 2px solid var(--ink); background: #2a2140; color: #d9c8ff; font: 400 0.76rem/1.3 var(--font-head); letter-spacing: 0.04em; white-space: nowrap; }
.mi-rx b { color: #fff; font-weight: 400; }
/* The Research Notebook Exp. icon in front of the amount: one rule instead of an <img> on each of ~1,500 missions. */
.mi-rx b::before, .mi-rexp-ic { content: ''; display: inline-block; width: 18px; height: 18px; margin: -4px 3px -4px 0; background: url('/assets/Currency/T_ui_Thumb_2_4001_S.webp') center / contain no-repeat; vertical-align: middle; }
.mi-note > .mi-rexp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--text); font-size: 0.9rem; }
.mi-rexp .mi-rexp-ic { flex: none; width: 26px; height: 26px; margin: 0; }
.mi-rexp small { color: var(--dim); font-size: 0.86rem; }
@media (max-width: 720px) {
    .mi-row { grid-template-columns: minmax(0, 1fr); }
    .mi-get { justify-content: flex-start; max-width: none; }
}

/* ── Research Notebook ─────────────────────────────────────────── */
.mi-note { display: grid; gap: 10px; padding: 14px; border: 3px solid var(--ink); background: var(--panel); box-shadow: 4px 4px 0 var(--violet); }
.mi-note > p { color: var(--dim); font-size: 0.9rem; }
.mi-note .se-h3 { margin: 0; }
.mi-grades { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--dim); font-size: 0.86rem; }
.mi-each { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--dim); font-size: 0.9rem; }
.mi-note .se-rank { grid-template-rows: auto 1fr; }
.mi-note .se-rw { border-left: 0; min-height: 62px; }

/* ── Folds: characters, events, past seasons ───────────────────── */
.mi-fold > summary img { flex: none; border: 2px solid var(--ink); background: var(--panel); object-fit: cover; }
.mi-char > summary img { width: 34px; height: 34px; border-radius: 50%; }
.mi-event > summary img { width: 80px; height: 45px; }
.mi-event > summary span { display: grid; gap: 2px; min-width: 0; }
.mi-event > summary small { color: var(--dim); font: 400 0.78rem/1.3 var(--font-body); letter-spacing: 0; text-transform: none; }
.mi-fold > summary .mi-soon { margin: 0; }
.mi-chars { display: grid; gap: 8px; }
.mi-evlink { display: flex; }

/* Motion hook (class set on <html> by js/missions.js while it animates). */
.mi-anim .mi-reveal { opacity: 0; }
