/* ═══════════════════════════════════════════════════════════════
   CLIMAX BATTLE (climax.php, /climax/<series>)
   On top of css/character.css (cd-* tokens, panels, tabs, item markup) and css/events.css (ev-* hero, quests,
   shop, lists); everything here is cx-* scoped. Static by design: no loaders or entrance animations.
   ═══════════════════════════════════════════════════════════════ */

.cx-note { margin: 8px 0 0; color: var(--text-3); font-size: 0.78rem; line-height: 1.45; }
.cx-nowrap { white-space: nowrap; }
.cx-k { margin: 10px 0 4px; color: var(--text-3); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.cd-jp .cx-k { letter-spacing: 0.2px; }
.cx-h { margin-top: 18px; }
.cx-more { margin-top: 10px; }
.cx-more > .ev-table-wrap, .cx-more > .ev-gachas, .cx-more > ul { margin-top: 8px; }
.cx-fold > summary {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--acc2);
    font-size: 0.86rem;
    font-weight: 600;
}
.cx-fold > summary:hover { color: #fff; }
.cx-fold > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cx-fold[open] > summary { margin-bottom: 12px; }

/* ── Hero ───────────────────────────────────────────────────────── */
.cx-hero-items { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.cx-hero-it { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; max-width: 100%; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.28); }
.cx-hero-it > .it-chip { flex: 1 1 11em; min-width: 0; }
.cx-hero-it .it-chip .it-ic { width: 44px; }
.cx-hero-it .it-n { white-space: normal; }

/* ── Run picker + run panel ─────────────────────────────────────── */
.cx-runchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.cx-runchip {
    display: inline-grid;
    gap: 0;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    text-decoration: none;
    line-height: 1.2;
}
.cx-runchip b { font-size: 0.84rem; color: var(--text); }
.cx-runchip small { color: var(--text-3); font-size: 0.7rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-runchip:hover { border-color: var(--acc2); }
.cx-runchip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cx-runchip.is-final { border-style: dashed; }
.cx-runchip.is-active { background: var(--acc); border-color: var(--acc2); box-shadow: 0 2px 10px color-mix(in srgb, var(--acc) 55%, transparent); }
.cx-runchip.is-active b, .cx-runchip.is-active small { color: var(--acc-ink); }
.cx-run { display: grid; gap: 10px; scroll-margin-top: 12px; }
.cx-run-badges { margin: 0; }
.cx-run-dates dd small { color: var(--text-3); }
.cx-days { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--text-2); font-size: 0.72rem; white-space: nowrap; }
.cx-emb-line { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--text-2); font-size: 0.82rem; }
.cx-emb-line > span:last-child { min-width: 0; }   /* the text wraps beside the Emblem icon on phones */
.cx-memb { margin: -4px 0 12px; }
.cx-eos { border-left-color: var(--gold); background: rgba(255, 213, 83, 0.08); }
.cx-run .cd-sub-h { margin: 4px 0 6px; }
.cx-table th[scope="row"] a { color: var(--acc2); font-weight: 700; text-decoration: none; }
.cx-table th[scope="row"] a:hover { text-decoration: underline; }
.cx-table td a { color: var(--text); text-decoration: none; }
.cx-table td a:hover { color: var(--acc2); text-decoration: underline; }
.cx-table tr.is-sel th, .cx-table tr.is-sel td { background: color-mix(in srgb, var(--acc) 16%, transparent); }
.cx-table td small { font-size: 0.74rem; }
/* keep labels and dates on one line: the wrapper scrolls sideways on phones */
.cx-table th[scope="row"], .cx-table th[scope="col"], .cx-table .ev-num, .cx-table small { white-space: nowrap; }
.cx-runs-table td:last-child { min-width: 15em; }

/* ── Classes at a glance ────────────────────────────────────────── */
.cx-classes td, .cx-classes th { vertical-align: middle; }
.cx-classes .ev-tiles { flex-wrap: nowrap; gap: 4px; }
.cx-classes .it-tile .it-ic { width: 38px; }
.cx-classes .it-tile .it-x { font-size: 0.66rem; }

/* ── Battles ────────────────────────────────────────────────────── */
.cx-class { gap: 10px; }
.cx-avg { margin: 6px 0 0; color: var(--gold); font-size: 0.78rem; font-weight: 600; }

.cx-foes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cx-foe { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); min-width: 0; }
.cx-foe.is-boss { box-shadow: 0 0 0 1px rgba(232, 65, 60, 0.3) inset; }
.cx-foe-ic { width: 64px; border-radius: 10px; }
.cx-foe .ev-plate { width: 104px; }   /* the boss plate (mhui_ev_plate_html) */
.cx-foe-ic .cx-cutin { object-fit: cover; object-position: 44% 24%; }
.cx-foe-body { display: grid; gap: 4px; min-width: 0; }
.cx-foe-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 0.98rem; }
.cx-foe-name b { overflow-wrap: anywhere; }
.cx-foe.is-boss .cx-foe-name b { color: #ffb0ad; }
.cx-stats { margin: 0; }
.cx-res { margin-top: 2px; }
.cx-res li { font-size: 0.72rem; }
.cx-res b { color: var(--up); font-variant-numeric: tabular-nums; }
@media (min-width: 576px) {
    .cx-foe { grid-template-columns: auto minmax(0, 1fr); }
    .cx-foe-ic { width: 76px; }
}

/* Phase timeline */
.cx-phases { position: relative; display: grid; gap: 8px; margin: 0; padding: 0 0 0 14px; list-style: none; }
.cx-phases::before { content: ''; position: absolute; top: 6px; bottom: 6px; left: 4px; width: 2px; border-radius: 2px; background: linear-gradient(var(--acc2), rgba(255, 255, 255, 0.08)); }
.cx-phase, .cx-trans { position: relative; min-width: 0; }
.cx-phase::before, .cx-trans::before { content: ''; position: absolute; left: -14px; width: 10px; height: 10px; border-radius: 50%; }
.cx-phase { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07); }
.cx-phase::before { top: 14px; background: var(--acc2); box-shadow: 0 0 0 3px var(--navy); }
.cx-phase-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cx-phase-no { font: 400 1.02rem/1.2 var(--font-display); color: #fff; letter-spacing: 0.3px; }
.cd-jp .cx-phase-no { letter-spacing: 0; }
.cx-trans { display: grid; gap: 6px; padding: 6px 12px 8px; }
.cx-trans::before { top: 12px; left: -13px; width: 8px; height: 8px; background: var(--gold); }
.cx-trans-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.84rem; font-weight: 600; color: var(--text-2); }
.cx-trans-hp { padding: 1px 9px; border-radius: 999px; background: rgba(255, 213, 83, 0.14); color: var(--gold); font-variant-numeric: tabular-nums; cursor: help; }
.cx-trans-arrow { color: var(--text-3); }
.cx-move { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; }
.cx-move .cx-k { margin: 0 4px 0 0; }

.cx-ai { margin-top: 6px; min-width: 0; }
.cx-ai + .cx-ai { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, 0.1); }
.cx-ai-who { margin: 0; font-weight: 700; font-size: 0.86rem; color: var(--text); overflow-wrap: anywhere; }
.cx-ai-static { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); }
.cx-same { margin: 6px 0 0; font-size: 0.8rem; }
.cx-ai p.ev-muted, .cx-alt p.ev-muted { margin: 4px 0 0; font-size: 0.8rem; }
.cx-pas { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cx-pas > li { padding: 6px 9px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); font-size: 0.86rem; min-width: 0; overflow-wrap: anywhere; }
.cx-pas > li > b { color: #fff; }
.cx-pas .ev-skilltext { font-size: 0.8rem; line-height: 1.5; }
.cx-rot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 4px; margin: 0; padding: 0; list-style: none; counter-reset: rot; }
.cx-rot > li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.cx-rot > li + li::before { content: '→'; color: var(--text-3); font-size: 0.75rem; }
.cx-sk {
    display: inline-block;
    max-width: 100%;
    padding: 1px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.cx-sk b { color: var(--gold); }
.cx-sk.is-pu { background: rgba(255, 213, 83, 0.14); box-shadow: 0 0 0 1px rgba(255, 213, 83, 0.45) inset; color: #ffe9a6; }
.cx-swap { margin-left: 2px; padding: 0 6px; border-radius: 999px; background: rgba(91, 149, 237, 0.2); color: #b9d2ff; font-size: 0.68rem; font-weight: 700; white-space: nowrap; cursor: help; }
.cx-alt { margin-top: 8px; padding: 6px 0 0 10px; border-left: 2px dashed rgba(255, 255, 255, 0.14); }
.cx-alt-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; font-size: 0.82rem; color: var(--text-2); }
.cx-internal .ev-skilltext { font-size: 0.8rem; }

/* ── Talk lines ─────────────────────────────────────────────────── */
.cx-line { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: start; min-width: 0; }
.cx-line-ic { display: block; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: rgba(0, 0, 0, 0.35); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12); }
.cx-line-ic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cx-line-ic:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cx-line-b { display: grid; gap: 4px; min-width: 0; }
.cx-line-x { margin: 0; padding: 7px 11px; border-radius: 4px 12px 12px 12px; background: rgba(255, 255, 255, 0.07); color: #e3e9f7; font-size: 0.86rem; line-height: 1.5; overflow-wrap: anywhere; }
.cx-line.is-cond .cx-line-x { background: rgba(91, 149, 237, 0.12); }
.cx-line-if { margin: 0; }
.cx-line-if a { color: inherit; text-decoration: none; }
.cx-line-if a:hover { text-decoration: underline; }
.cx-line-if .ev-badge { white-space: normal; }
.cx-trans .cx-line + .cx-line { margin-top: 2px; }
.cx-lines { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cx-lines > li { display: grid; gap: 6px; }
.cx-line-k { margin: 0; color: var(--text-3); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.4px; }
@media (max-width: 575.98px) { .cx-br { display: none; } }   /* the game's dialog-box wraps reflow on phones */

/* ── Event Shop ─────────────────────────────────────────────────── */
.cx-allbtn { padding: 6px 12px; font-size: 0.8rem; }
.cx-allbtn[aria-pressed="true"] { background: var(--acc); border-color: var(--acc2); color: var(--acc-ink) !important; }
.cx-shop li.is-key { background: rgba(255, 213, 83, 0.08); box-shadow: 0 0 0 1px rgba(255, 213, 83, 0.3) inset; }
.cx-shop li.is-off { opacity: 0.5; }
.cx-where { color: var(--text-3); font-size: 0.72rem; line-height: 1.35; }
.cx-twice { color: var(--enh); font-size: 0.72rem; font-weight: 600; }
.cx-spend { font-size: 0.72rem; }
.cx-spend a { color: var(--acc2) !important; }

/* ── Missions ───────────────────────────────────────────────────── */
.cx-mrun-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; font-size: 0.82rem; }
.cx-mbtn { margin-left: auto; padding: 5px 12px; font-size: 0.8rem; }
.cx-mh { margin: 14px 0 6px; }
.cx-mh:first-child { margin-top: 0; }
.cx-mlist .ev-items .it-chip .it-ic { width: 32px; }
.cx-team { margin-bottom: 12px; }
.cx-team .cd-sub-h { margin-top: 0; }
.cx-team-list { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0; padding: 0; list-style: none; }
.cx-team-list li { display: grid; justify-items: center; gap: 2px; width: 64px; }
.cx-team-list .it-tile .it-ic { width: 52px; }
.cx-team-list small { color: var(--text-2); font-size: 0.68rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }

/* ── Rules / help ───────────────────────────────────────────────── */
.cx-rules { display: grid; gap: 6px; margin: 0 0 14px; padding: 0 0 0 18px; font-size: 0.88rem; color: var(--text); }
.cx-rules li::marker { color: var(--acc2); }
.cx-rules small { font-size: 0.76rem; }
.cx-help { display: grid; gap: 12px; }
.cx-help-t { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); }
.cx-help-t h3 { margin: 0 0 6px; font-size: 0.92rem; font-weight: 700; color: #fff; }
.cx-help-t p { margin: 0; color: #d6def0; font-size: 0.84rem; line-height: 1.55; overflow-wrap: anywhere; }
.cx-help-t p + p { margin-top: 8px; }

/* ── Side ───────────────────────────────────────────────────────── */
.cx-strip { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.cx-bosses a, .cx-bosses span.is-current { align-items: baseline; }
.cx-bosses small { color: var(--text-3); font-size: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-datanote { margin: 0; padding: 0 4px; }

