/* ═══════════════════════════════════════════════════════════════
   CHARACTER PAGE (character.php) — everything is ch-* scoped.
   Loaded after css/home.css, which supplies the tokens (--ink, --panel, --yellow ...), the fonts, the page
   frame (.hm) and the section heads (.hm-head). Each Battle Style sets --acc to its role colour.
   Motion comes from js/character.js (anime.js) and only enhances: without JavaScript every Battle Style is
   shown in full, one after the other.
   ═══════════════════════════════════════════════════════════════ */

.ch { --acc: var(--yellow); gap: 34px; }
.ch h3, .ch h4 { margin: 0; }
.ch dl, .ch dd { margin: 0; }
.ch em { color: var(--dim); font-style: normal; }
.ch button { font: inherit; color: inherit; cursor: pointer; }
.ch button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.ch-head-note { flex: none; max-width: 46%; color: var(--dim); font-size: 0.86rem; text-align: right; }
.ch-sec > .hm-head, .ch-styles > .hm-head { margin-bottom: 16px; }

.ch-card { padding: 16px 18px; border: 3px solid var(--ink); background: var(--panel); box-shadow: 5px 5px 0 var(--ink); }
.ch-h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px !important; font: 400 1.15rem/1.1 var(--font-head); letter-spacing: 0.03em; text-transform: uppercase; }
.ch-role-ico { flex: none; filter: drop-shadow(2px 2px 0 var(--ink)); }
.ch-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--panel-2) transparent; }

/* ── Hero ──────────────────────────────────────────────────────── */
.ch-hero { --side: var(--blue); position: relative; display: grid; align-items: end; overflow: hidden; min-height: 300px; margin-top: 6px; border: 4px solid var(--ink); background: var(--panel); box-shadow: 8px 8px 0 var(--side); isolation: isolate; }
.ch-villain { --side: var(--red); }
.ch-hero-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; max-width: none !important; object-fit: cover; object-position: center 30%; opacity: 0.5; }
.ch-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(14, 15, 19, 0.96) 0%, rgba(14, 15, 19, 0.8) 44%, rgba(14, 15, 19, 0.15) 100%), linear-gradient(0deg, rgba(14, 15, 19, 0.85), transparent 45%); }
.ch-hero-text { position: relative; z-index: 1; display: grid; gap: 10px; padding: 20px 20px 62px; }
.ch-crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--dim); font-size: 0.86rem; }
.ch-crumbs a { color: var(--text); border-bottom: 1px solid var(--line); }
.ch-crumbs a:hover { color: var(--yellow); }
.ch-hero .hm-kicker { margin-bottom: 0 !important; }
.ch-hero .hm-kicker span { background: var(--side); color: #fff; }
.ch-name { margin: 0; font: 400 clamp(2.4rem, 7.4vw, 4.6rem)/0.9 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; text-shadow: 4px 4px 0 var(--ink); overflow-wrap: anywhere; }
.ch-tagline { max-width: 56ch; color: #dfe2e8; font-size: 1.02rem; text-shadow: 1px 1px 0 var(--ink); }
.ch-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px !important; }
.ch-facts div { display: grid; gap: 2px; min-width: 76px; padding: 7px 12px 6px; border: 2px solid var(--ink); background: rgba(7, 8, 10, 0.78); }
.ch-facts dt { color: var(--yellow); font: 400 0.68rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; }
.ch-facts dd { font: 400 1.05rem/1.1 var(--font-head); }
.ch-facts dd em { font-size: 0.8rem; }
.ch-hero-art { position: absolute; right: -4%; bottom: 0; z-index: 0; width: min(62%, 430px); pointer-events: none; opacity: 0.32; }
.ch-hero-art img { display: block; width: 100%; height: auto; filter: drop-shadow(8px 8px 0 rgba(7, 8, 10, 0.6)); }
.ch-step { position: absolute; bottom: 10px; z-index: 2; display: flex; align-items: center; gap: 8px; max-width: 46%; padding: 4px 10px 4px 6px; border: 2px solid var(--ink); background: var(--panel-2); font: 400 0.9rem/1.1 var(--font-head); box-shadow: 3px 3px 0 var(--ink); transition: background 0.15s, color 0.15s, transform 0.15s; }
.ch-step:hover { background: var(--yellow); color: var(--ink) !important; transform: translateY(-2px); }
.ch-step-prev { left: 12px; }
.ch-step-next { right: 12px; flex-direction: row-reverse; padding: 4px 6px 4px 10px; }
.ch-step img { flex: none; width: 34px; height: 34px; border: 2px solid var(--ink); background: var(--ink); object-fit: cover; }
.ch-step b { overflow: hidden; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.ch-step span { font-size: 1.3rem; line-height: 1; }
@media (min-width: 860px) {
    .ch-hero { min-height: 400px; }
    .ch-hero-text { max-width: 62%; padding: 28px 30px 70px; }
    .ch-hero-art { right: 2%; width: min(44%, 520px); opacity: 1; }
}

/* ── Battle Style tabs ─────────────────────────────────────────── */
.ch-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin-bottom: 18px; }
.ch-tab { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 12px 6px 6px; border: 3px solid var(--ink); background: var(--panel); box-shadow: 4px 4px 0 var(--ink); transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.ch-tab:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--acc); }
.ch-tab.is-on { background: var(--panel-2); box-shadow: 5px 5px 0 var(--acc); }
.ch-tab-img { flex: none; width: 56px; height: 56px; border: 2px solid var(--ink); background: var(--ink) var(--role-bg, none) center / cover; object-fit: cover; }
.ch-tab span { flex: 1; min-width: 0; }
.ch-tab small { display: block; color: var(--dim); font-size: 0.74rem; }
.ch-tab b { display: block; overflow: hidden; font: 400 1.1rem/1.15 var(--font-head); text-overflow: ellipsis; white-space: nowrap; }
.ch-tab.is-on b { color: var(--yellow); }

/* ── One Battle Style ──────────────────────────────────────────── */
.ch-style { display: grid; gap: 18px; min-width: 0; scroll-margin-top: 80px; }
.ch-style > * { min-width: 0; }
.ch-style + .ch-style { margin-top: 34px; padding-top: 30px; border-top: 3px dashed var(--line); }
.ch-js .ch-style:not(.is-on) { display: none; }
.ch-js .ch-style + .ch-style { margin-top: 0; padding-top: 0; border-top: 0; }
.ch-style-head { display: grid; gap: 14px; overflow: hidden; border: 4px solid var(--ink); background: var(--panel); box-shadow: 7px 7px 0 var(--acc); }
/* The game's style thumbnail fills the box edge to edge; its rounded, see-through corners show the role's own
   tile from the character select screen (160 x 160, repeated) instead of black. */
.ch-style-art { display: block; width: 100%; height: 300px; max-width: none !important; object-fit: cover; object-position: center 22%; background: var(--ink) var(--role-bg, none) repeat center / 110px; }
.ch-style-txt { display: grid; gap: 14px; align-content: start; padding: 0 16px 16px; }
.ch-style-txt > * { min-width: 0; }
.ch-style-main { display: grid; gap: 10px; align-content: start; }
/* Role and its team bonus sit beside the style's facts on wide screens, below them on narrow ones. */
.ch-rolebox { align-self: start; padding: 12px 14px; border: 2px solid var(--ink); border-left: 6px solid var(--acc); background: var(--panel-2); }
.ch-rolebox .ch-h4 { margin-bottom: 6px !important; color: var(--acc); font-size: 1.05rem; }
.ch-rolebox p { color: #dfe2e8; font-size: 0.9rem; }
.ch-rolebox .ch-mini th[scope="row"] { white-space: normal; }
@media (min-width: 1100px) { .ch-style-txt { grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr); gap: 20px; } }
.ch-style-kicker { color: var(--acc); font: 400 0.8rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; }
.ch-style-name { font: 400 clamp(1.8rem, 5vw, 2.6rem)/0.95 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; text-shadow: 3px 3px 0 var(--ink); overflow-wrap: anywhere; }
.ch-strengths { max-width: 70ch; color: #dfe2e8; }
.ch-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-pills li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 12px; border: 2px solid var(--ink); background: var(--panel-2); }
.ch-pills li > span { min-width: 0; }
.ch-pills small { display: block; color: var(--dim); font: 400 0.66rem/1.1 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; }
.ch-pills b { display: block; font: 400 1.05rem/1.15 var(--font-head); }
.ch-pills li:not(.ch-pill-role) { display: grid; gap: 2px; }
.ch-pill-hp b { color: var(--green); font-size: 1.4rem; }
.ch-pills b em { margin-left: 4px; font-size: 0.8rem; }

.ch-get { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 0.92rem; }
.ch-get-roll { padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.ch-get-roll:hover b { color: var(--yellow); }
.ch-get-ticket { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); }
@media (min-width: 760px) {
    /* The art fills the left column without setting the box's height: the text beside it does. */
    .ch-style-head { position: relative; grid-template-columns: clamp(230px, 23%, 300px) minmax(0, 1fr); gap: 0; min-height: 260px; }
    .ch-style-art { position: absolute; top: 0; left: 0; width: clamp(230px, 23%, 300px); height: 100%; border-right: 4px solid var(--ink); }
    .ch-style-txt { grid-column: 2; padding: 18px 20px; }
}

.ch-tune p { color: #dfe2e8; font-size: 0.94rem; }
/* Tuning skills side by side; the Special Tuning Skill (11 levels) gets twice the room. */
.ch-tune-list { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.ch-mini { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.ch-mini caption { padding: 0 0 6px; color: var(--text); caption-side: top; font-size: 0.9rem; text-align: left; }
.ch-mini th, .ch-mini td { padding: 4px 8px; border: 1px solid var(--line); text-align: center; white-space: nowrap; }
.ch-mini th { color: var(--dim); font-weight: 400; }
.ch-mini th[scope="row"] { text-align: left; }
.ch-mini td { background: rgba(7, 8, 10, 0.35); }
.ch-tune-row { flex: 1 1 250px; min-width: 0; padding: 10px 12px; border: 2px solid var(--ink); background: var(--panel-2); }
.ch-tune-unique { flex: 2 1 420px; border-left: 6px solid var(--yellow); }
.ch-tune-row b { color: var(--text); font: 400 1.02rem/1.2 var(--font-head); }
.ch-tune-tag { margin-bottom: 8px !important; color: var(--yellow) !important; font: 400 0.76rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; }
.ch-tune-top { display: flex; align-items: center; gap: 12px; }
.ch-tune-top img { flex: none; width: 52px; height: 52px; }
.ch-tune .hm-note { margin-top: 6px; font-size: 0.82rem; }

/* ── Skill level bar ───────────────────────────────────────────── */
.ch-lvbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border: 3px solid var(--ink); background: var(--panel-2); box-shadow: 4px 4px 0 var(--ink); }
.ch-lvbar span { margin-right: 6px; color: var(--yellow); font: 400 0.82rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; }
.ch-lvbar button { min-width: 34px; padding: 5px 0; border: 2px solid var(--ink); background: var(--panel); font: 400 1rem/1 var(--font-head); font-variant-numeric: tabular-nums; transition: background 0.12s, color 0.12s, transform 0.12s; }
.ch-lvbar button:hover { transform: translateY(-2px); }
.ch-lvbar button.is-on { background: var(--yellow); color: var(--ink); }

/* ── Skills ────────────────────────────────────────────────────── */
.ch-skills { display: grid; gap: 22px; }
.ch-skill { display: grid; gap: 14px; min-width: 0; padding: 0 0 16px; border: 3px solid var(--ink); background: var(--panel); box-shadow: 6px 6px 0 var(--ink); }
.ch-skill > * { min-width: 0; margin-right: 16px; margin-left: 16px; }
.ch-skill-head { display: flex; align-items: center; gap: 14px; margin: 0 !important; padding: 10px 16px; border-bottom: 3px solid var(--ink); background: linear-gradient(100deg, var(--panel-2) 0 68%, transparent 68.2%), repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 0 6px, transparent 6px 12px); }
.ch-slot { flex: none; display: grid; place-items: center; width: 50px; height: 50px; background: var(--acc); color: var(--ink); font: 700 2rem/1 Georgia, 'Times New Roman', serif; transform: skewX(-9deg); box-shadow: 3px 3px 0 var(--ink); }
.ch-skill-kicker { color: var(--acc); font: 400 0.76rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; }
.ch-skill-name { margin-top: 4px !important; font: 400 clamp(1.3rem, 3.4vw, 1.75rem)/1.05 var(--font-head); text-transform: uppercase; text-shadow: 2px 2px 0 var(--ink); overflow-wrap: anywhere; }
.ch-skill-body { display: grid; gap: 14px; align-items: start; }
.ch-skill-img { display: block; width: min(100%, 250px); height: auto; margin: 0 auto; border: 2px solid var(--ink); background: var(--ink); }
.ch-skill-txt { display: grid; gap: 12px; color: #dfe2e8; }
@media (min-width: 640px) { .ch-skill-body { grid-template-columns: 200px minmax(0, 1fr); } }
.ch-derived { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--ink); border-left: 6px solid var(--acc); background: var(--panel-2); }
/* Skill previews are wide (272 x 148): shown whole, never cropped to a square. */
.ch-derived img { flex: none; width: clamp(96px, 26%, 150px); height: auto; border: 2px solid var(--ink); background: var(--ink); }
.ch-derived b { color: var(--text); font: 400 1.05rem/1.3 var(--font-head); }
.ch-input { display: inline-block; padding: 1px 8px; background: var(--acc); color: var(--ink); font: 400 0.74rem/1.5 var(--font-head); letter-spacing: 0.06em; text-transform: uppercase; }

/* Level table: first column = what, one column per skill level. */
.ch-lv { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ch-lv caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ch-lv th, .ch-lv td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.ch-lv thead td, .ch-lv tbody th { position: sticky; left: 0; z-index: 1; min-width: 150px; max-width: 46vw; background: var(--panel); text-align: left; white-space: normal; }
.ch-lv thead th { padding: 0 2px 6px; border-bottom: 2px solid var(--ink); }
.ch-lv thead button { width: 100%; padding: 4px 6px; border: 2px solid var(--ink); background: var(--panel-2); font: 400 0.82rem/1 var(--font-head); }
.ch-lv thead .ch-one { padding: 4px 8px 6px; color: var(--dim); font: 400 0.82rem/1 var(--font-head); text-align: center; }
.ch-lv tbody th { font-weight: 400; }
.ch-lv tbody th > span { font: 400 1rem/1.2 var(--font-head); }
.ch-lv .ch-dmg td { color: #fff; font-size: 1rem; }
.ch-lv .ch-sub th > span, .ch-lv .ch-mag th > span { color: var(--dim); font: inherit; }
.ch-lv .ch-sub th { padding-left: 20px; }
.ch-lv .ch-sub td, .ch-lv .ch-mag td { color: #cfd3db; }
.ch-lv .ch-mag-first th, .ch-lv .ch-mag-first td { border-top: 2px solid var(--ink); }
.ch-lv td.ch-up { color: var(--yellow); font-weight: 700; }
.ch-lv td.ch-all { color: #fff; text-align: center; }
.ch-lv tbody tr:hover td { background: rgba(255, 255, 255, 0.04); }
.ch-traits { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px !important; }
.ch-traits li { padding: 1px 7px; border: 1px solid var(--line); background: rgba(7, 8, 10, 0.4); color: var(--dim); font-size: 0.72rem; line-height: 1.5; white-space: nowrap; }
.ch-flags { margin-top: 0 !important; }
.ch-flags li { border-color: rgba(255, 210, 1, 0.35); color: #e9d98a; }
/* The selected level: generated for levels 1-10 (cells and headers carry .l<level>). */
.ch-style[data-lv="1"] .l1, .ch-style[data-lv="2"] .l2, .ch-style[data-lv="3"] .l3, .ch-style[data-lv="4"] .l4, .ch-style[data-lv="5"] .l5,
.ch-style[data-lv="6"] .l6, .ch-style[data-lv="7"] .l7, .ch-style[data-lv="8"] .l8, .ch-style[data-lv="9"] .l9, .ch-style[data-lv="10"] .l10 { background: rgba(255, 210, 1, 0.13); }
.ch-style[data-lv="1"] thead .l1 button, .ch-style[data-lv="2"] thead .l2 button, .ch-style[data-lv="3"] thead .l3 button, .ch-style[data-lv="4"] thead .l4 button,
.ch-style[data-lv="5"] thead .l5 button, .ch-style[data-lv="6"] thead .l6 button, .ch-style[data-lv="7"] thead .l7 button, .ch-style[data-lv="8"] thead .l8 button,
.ch-style[data-lv="9"] thead .l9 button, .ch-style[data-lv="10"] thead .l10 button { background: var(--yellow); color: var(--ink); }

.ch-more > summary { cursor: pointer; color: var(--yellow); font: 400 0.84rem/1.2 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; }
.ch-more > summary:hover { color: #fff; }
.ch-more[open] > summary { margin-bottom: 8px; }
.ch-ups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 4px 12px; }
.ch-ups li { padding: 3px 8px; color: #cfd3db; font-size: 0.86rem; }
.ch-ups b { display: inline-block; min-width: 38px; color: var(--text); font: 400 0.9rem/1 var(--font-head); }

/* ── Special action, stats, movement, projectiles ──────────────── */
.ch-special { display: grid; gap: 14px; }
.ch-special > * { min-width: 0; }
.ch-special-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.ch-special-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 2px solid var(--ink); background: var(--panel-2); color: #dfe2e8; }
.ch-special-item img { flex: none; width: 96px; height: 96px; border: 2px solid var(--ink); background: var(--ink); object-fit: cover; }
.ch-special-item b { color: var(--text); font: 400 1.15rem/1.4 var(--font-head); text-transform: uppercase; }
/* Cards of different heights: packed into balanced columns (top to bottom, then the next column) so no row is
   left half empty under a short card. */
.ch-grid { columns: 4 270px; column-gap: 18px; }
.ch-grid > .ch-card { break-inside: avoid; margin: 0 5px 18px 0; }
.ch-kv div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.ch-kv div:last-child { border-bottom: 0; }
.ch-kv dt { color: #cfd3db; font-size: 0.9rem; }
.ch-kv dd { flex: none; font: 400 1.05rem/1.1 var(--font-head); font-variant-numeric: tabular-nums; }
.ch-legend { margin-top: 0 !important; }
.ch-plain { width: 100%; border-collapse: collapse; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.ch-plain th, .ch-plain td { padding: 5px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.ch-plain thead th { color: var(--yellow); font: 400 0.76rem/1.2 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; }
.ch-plain tbody th { font-weight: 400; color: var(--text); }
.ch-plain td { color: #cfd3db; }

/* ── Costumes, emotes, voice lines ─────────────────────────────────
   A tile is layered like the game's own item thumbnails: the item type's background (160 x 160), the item, then
   the rarity frame on top. The frames have rounded corners, so the tile is rounded to match. */
.ch-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px 10px; }
.ch-items li { min-width: 0; }
.ch-items-named { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.ch-items small { display: block; margin-top: 5px; overflow: hidden; color: #cfd3db; font-size: 0.76rem; line-height: 1.2; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.ch-item { position: relative; display: block; overflow: hidden; aspect-ratio: 1; border-radius: 9%; background: var(--panel-2) center / cover no-repeat; transition: transform 0.15s, filter 0.15s; }
.ch-item-cos { background-image: url('/assets/icons/T_ui_GashaThumb_bg03.png'); }
.ch-item-emo { background-image: url('/assets/icons/T_ui_GashaThumb_bg01.png'); }
.ch-item-voice { background-image: url('/assets/icons/T_ui_GashaThumb_bg02.png'); }
.ch-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ch-item::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: center / 100% 100% no-repeat; box-shadow: inset 0 0 0 3px rgba(7, 8, 10, 0.55); pointer-events: none; }
.ch-r-r::after { background-image: url('/assets/icons/gasha_r_frame.png'); box-shadow: none; }
.ch-r-sr::after { background-image: url('/assets/icons/gasha_sr_frame.png'); box-shadow: none; }
.ch-r-ssr::after, .ch-r-essr::after { background-image: url('/assets/icons/gasha_ssr_frame.png'); box-shadow: none; }
/* Rarity stars, over the frame at the bottom centre: none for C, 1 for R, 2 for SR, 3 for SSR. The game's star
   strips are 160 x 25, the same width as a tile, with the stars already centred. */
.ch-item::before { content: ''; position: absolute; inset: 0; z-index: 2; background: 50% 97% / 100% auto no-repeat; pointer-events: none; }
.ch-r-r::before { background-image: url('/assets/icons/rarity_r_1star.png'); }
.ch-r-sr::before { background-image: url('/assets/icons/rarity_sr_2star.png'); }
.ch-r-ssr::before, .ch-r-essr::before { background-image: url('/assets/icons/rarity_pur_3star.png'); }
a.ch-item:hover { transform: translateY(-3px) scale(1.04); filter: brightness(1.12); }
.ch-voices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 10px 14px; }
.ch-voices li { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 7px 12px 7px 7px; border: 2px solid var(--ink); background: var(--panel); box-shadow: 3px 3px 0 var(--ink); }
.ch-voices .ch-item { flex: none; width: 58px; }
.ch-voices .ch-item img { object-position: center top; }
.ch-voices .ch-item::before { background-size: 150% auto; }   /* small tile: stars drawn larger to stay readable */
.ch-voices p { min-width: 0; }
.ch-voices b { display: block; font: 400 1rem/1.2 var(--font-head); }
.ch-voices q { display: block; margin-top: 2px; color: #cfd3db; font-size: 0.86rem; line-height: 1.3; quotes: '\201C' '\201D'; }

.ch-notes { display: grid; gap: 8px; padding-left: 18px !important; list-style: square !important; color: #cfd3db; font-size: 0.92rem; }
.ch-notes b { color: var(--text); }

/* ── Asset viewer (button in the top box + dialog) ─────────────── */
.ch-hero-actions { margin-top: 4px !important; }
.ch .ch-btn { display: inline-block; padding: 8px 20px; border: 3px solid var(--ink); background: var(--yellow); color: var(--ink); font: 400 1rem/1 var(--font-head); letter-spacing: 0.04em; text-transform: uppercase; transform: skewX(-9deg); box-shadow: 4px 4px 0 var(--ink); transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.ch .ch-btn span { display: inline-block; transform: skewX(9deg); }
.ch .ch-btn:hover { background: #fff; transform: skewX(-9deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.ch-dialog { width: min(1120px, 94vw); max-height: 88vh; padding: 0; overflow: hidden; border: 4px solid var(--ink); background: var(--panel); color: var(--text); box-shadow: 8px 8px 0 var(--yellow); }
.ch-dialog::backdrop { background: rgba(7, 8, 10, 0.78); }
.ch-dialog-in { display: flex; flex-direction: column; max-height: calc(88vh - 8px); }
.ch-dialog-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 3px solid var(--ink); background: var(--panel-2); }
.ch-dialog-head .hm-h2 { font-size: clamp(1.15rem, 3vw, 1.6rem); }
.ch-dialog-head small { color: var(--yellow); font-size: 0.6em; letter-spacing: 0.1em; }
.ch .ch-dialog-x { flex: none; width: 38px; height: 38px; border: 3px solid var(--ink); background: var(--red); color: #fff; font: 700 1.5rem/1 Arial, sans-serif; }
.ch .ch-dialog-x:hover { background: #fff; color: var(--ink); }
.ch-dialog-body { padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.ch-dialog-body .hm-h3 { margin: 18px 0 10px; color: var(--yellow); }
.ch-dialog-body .hm-h3:first-child { margin-top: 0; }
.ch-dialog-body .hm-note { margin-top: 16px !important; }
.ch-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.ch-assets li { min-width: 0; }
.ch-assets a { display: grid; gap: 6px; height: 100%; padding: 8px; border: 2px solid var(--ink); background: var(--panel-2); transition: border-color 0.15s, transform 0.15s; }
.ch-assets a:hover { border-color: var(--yellow); transform: translateY(-2px); }
/* Checkerboard behind the image, so see-through areas read as see-through. */
.ch-assets img { display: block; width: 100%; height: 130px; object-fit: contain; background: repeating-conic-gradient(#2a2d36 0% 25%, #20232b 0% 50%) 0 0 / 16px 16px; }
.ch-assets span { overflow: hidden; color: var(--dim); font-size: 0.7rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

/* Motion hook: hidden until revealed, only while js/character.js is animating (class set on <html>). */
.ch-anim .ch-reveal { opacity: 0; }

@media (max-width: 560px) {
    .ch-head-note { display: none; }
    .ch-step b { display: none; }
    .ch-lv th, .ch-lv td { padding: 5px 6px; }
    .ch-lv thead td, .ch-lv tbody th { min-width: 120px; }
    /* Hit facts become one wrapped line of small text, so a row stays short next to its numbers. */
    .ch-lv .ch-traits { display: block; }
    .ch-lv .ch-traits li { display: inline; padding: 0; border: 0; background: none; font-size: 0.7rem; white-space: normal; }
    .ch-lv .ch-traits li + li::before { content: ' · '; }
}
