.roles-document {
  color-scheme: dark;
  --role-bg: #060911;
  --role-card: #0d1524;
  --role-raised: #172033;
  --role-line: #ffffff14;
  --role-ink: #e9eff7;
  --role-muted: #8698ad;
  --role-faint: #5e7188;
  --role-blue: #57b6ff;
  --role-gold: #d9b23f;
  --role-amber: #f5b13d;
  --role-ok: #57d6a6;
  background-color: var(--role-bg);
  background-image: linear-gradient(#10192a55 1px, transparent 1px), linear-gradient(90deg, #10192a55 1px, transparent 1px), linear-gradient(180deg, transparent 0, var(--role-bg) 72%);
  background-size: 44px 44px, 44px 44px, 100% 420px;
  background-repeat: repeat, repeat, no-repeat;
  color: var(--role-ink);
  font-family: "Space Grotesk", sans-serif;
}

.roles-main { width: min(100%, 48rem); min-width: 0; margin-inline: auto; padding: clamp(1.25rem, 4vw, 2.75rem) 0 3rem; }
.roles-loading, .roles-error { padding: 1.25rem; border: 1px solid var(--role-line); border-radius: .875rem; background: var(--role-card); color: var(--role-muted); text-align: center; }
.roles-error h1 { color: var(--role-ink); }
.roles-error p { max-width: 52ch; margin: .75rem auto 1.25rem; }

.role-eyebrow, .role-kicker, .role-chip, .role-type, .role-card-meta, .role-stage-level, .snapshot-note, .section-index, .role-tabs, .rank-list strong, .role-inline-code {
  font-family: "JetBrains Mono", monospace;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.role-eyebrow, .role-kicker, .section-index { color: var(--role-muted); }
.role-eyebrow { display: inline-flex; align-items: center; gap: .55rem; }
.role-eyebrow::before { width: 1rem; height: 1px; background: currentColor; content: ""; }

.roles-hero { padding: 0 0 1.1rem; }
.roles-hero h1, .role-page-title h1 { max-width: 18ch; margin: .6rem 0; font-size: clamp(1.9rem, 5vw, 2.75rem); line-height: 1.08; letter-spacing: -.045em; }
.roles-hero p, .role-lead { max-width: 58ch; margin: .6rem 0 0; color: var(--role-muted); font-size: .98rem; line-height: 1.6; }
.role-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.role-button, .copy-link, .role-tab, .dialog-close { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: .5rem; border: 1px solid var(--role-line); border-radius: 999px; background: var(--role-raised); color: var(--role-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease; }
.role-button { min-height: 44px; padding: .55rem 1rem; }
a.role-button.primary, a.role-button.primary:link, a.role-button.primary:visited, a.role-button.primary:not(.btn):not(.play):not(.mobile-play):hover, a.role-button.primary:not(.btn):not(.play):not(.mobile-play):active, a.role-button.primary:not(.btn):not(.play):not(.mobile-play):focus, a.role-button.primary:not(.btn):not(.play):not(.mobile-play):focus-visible { border-color: #f5b13d; background: linear-gradient(135deg, #ffc44d, #f59e0b); color: #1a1206; fill: #1a1206; text-decoration: none; }
a.role-button.primary::before { content: none; }
a.role-button.primary svg, a.role-button.primary [aria-hidden="true"] { color: #1a1206; fill: currentColor; text-decoration: none; } .role-button.primary .telegram-icon { display: block; flex: 0 0 22px; width: 22px; height: 22px; } .role-button.primary { text-decoration: none; }
.role-button:hover, .copy-link:hover, .role-tab:hover { border-color: var(--role-blue); transform: translateY(-1px); }
.role-button.primary:hover { border-color: #ffd675; box-shadow: 0 0 24px #f5b13d3b; }
.role-button:focus-visible, .copy-link:focus-visible, .role-tab:focus-visible, .skill-node:focus-visible, .dialog-close:focus-visible, .role-link:focus-visible, summary:focus-visible { outline: 3px solid #f5b13d; outline-offset: 3px; }

.role-section { margin-top: 1.8rem; }
.role-section-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .6rem 1rem; margin-bottom: .85rem; }
.role-section-heading h2, .role-section h2 { margin: .3rem 0 0; font-size: clamp(1.15rem, 2.6vw, 1.55rem); line-height: 1.2; letter-spacing: -.025em; }
.role-section-heading p { max-width: 48ch; margin: 0; color: var(--role-muted); line-height: 1.5; }
.section-index { font-size: .62rem; }
.role-grid { display: grid; gap: .75rem; }
.role-card, .set-card, .elite-card, .super-card, .layer-card, .role-faq, .roles-faq, .role-cta-band, .role-page-hero, .role-stage, .skill-node, .role-rule-box { --accent: var(--role-gold); position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--role-line); border-radius: .875rem; background: var(--role-card); box-shadow: 0 10px 30px #00000012; transition: border-color .2s ease, box-shadow .2s ease; }
.role-card::before, .set-card::before, .elite-card::before, .super-card::before, .layer-card::before, .role-stage::before, .skill-node::before { position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--accent); content: ""; opacity: .8; }
.role-card[data-role="tank"], .role-page[data-role="tank"] { --accent: #65b9ed; --accent-soft: #65b9ed18; }
.role-card[data-role="dps"], .role-page[data-role="dps"] { --accent: #f5a55e; --accent-soft: #f5a55e18; }
.role-card[data-role="support"], .role-page[data-role="support"] { --accent: #5bd1ad; --accent-soft: #5bd1ad18; }
.role-card { display: flex; flex-direction: column; }
.role-card:hover, .set-card:hover, .elite-card:hover, .skill-node:hover { border-color: color-mix(in srgb, var(--accent) 58%, transparent); box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 10%, transparent); }
.role-card-portrait { display: grid; min-height: 148px; place-items: center; overflow: hidden; background: radial-gradient(ellipse, var(--accent-soft), transparent 70%), #0b1220; }
.role-card-portrait img { display: block; width: 100%; height: 148px; padding: .65rem; object-fit: contain; transition: transform .25s ease; }
.role-card:hover .role-card-portrait img { transform: scale(1.06); }
.role-card-body { display: flex; flex: 1; flex-direction: column; padding: .9rem 1rem; }
.role-card-title-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.role-card-meta { display: flex; flex-wrap: wrap; gap: .35rem .55rem; margin-top: .35rem; color: var(--role-muted); font-size: .57rem; letter-spacing: .08em; }
.role-card h3, .set-card h3, .elite-card h3, .super-card h3, .layer-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.role-emoji { color: var(--accent); font-size: 1.1rem; }
.role-card p { margin: .5rem 0 .7rem; color: var(--role-muted); font-size: .9rem; line-height: 1.45; }
.role-core-line { display: block; margin-top: auto; padding: .55rem .65rem; border-left: 2px solid var(--accent); border-radius: 0 .5rem .5rem 0; background: var(--accent-soft); font-size: .8rem; line-height: 1.45; }
.role-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: .8rem; }
.role-link { color: var(--role-blue); font-weight: 700; text-decoration: none; }
.role-link:hover { text-decoration: underline; }
.copy-link { min-height: 44px; padding: 0 .8rem; font-size: .78rem; }
.role-card .copy-link { display: none; }

.layer-grid { display: grid; gap: .6rem; }
.layer-card { padding: .8rem .9rem  .8rem 1rem; }
.layer-card h3 { font-size: .93rem; }
.layer-card p { margin: .35rem 0 0; color: var(--role-muted); font-size: .82rem; line-height: 1.45; }
.role-breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .8rem; color: var(--role-faint); font-family: "JetBrains Mono", monospace; font-size: .68rem; }
.role-breadcrumbs a { color: var(--role-muted); text-decoration: none; }
.role-breadcrumbs a:hover { color: var(--role-blue); }
.role-page-hero { display: flex; min-height: 88px; align-items: center; gap: 1rem; padding: .8rem; background: radial-gradient(ellipse at 8% 50%, var(--accent-soft), transparent 58%), var(--role-card); }
.role-page-copy { min-width: 0; }
.role-page-title h1 { margin: .32rem 0; color: var(--accent); font-size: clamp(1.6rem, 5vw, 2.15rem); }
.role-lead { margin: .25rem 0 0; font-size: .88rem; }
.role-page-art { flex: 0 0 88px; width: 88px; height: 88px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: .75rem; background: radial-gradient(ellipse, var(--accent-soft), transparent 75%); }
.role-page-art img { display: block; width: 100%; height: 100%; padding: .25rem; object-fit: contain; }
.role-core { display: flex; flex-wrap: wrap; gap: .4rem .7rem; margin-top: .65rem; color: var(--role-muted); font-size: .78rem; }
.role-core > span:first-child { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.role-page-hero-compact .role-lead, .role-page-hero-compact .role-core, .role-page-hero-compact .role-actions { display: none; }
.role-page-hero-compact { min-height: 72px; }
.role-page-hero-compact .role-page-art { flex-basis: 64px; width: 64px; height: 64px; }
.role-role-switch { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; }
.role-role-switch a { display: inline-flex; min-height: 44px; align-items: center; gap: .35rem; padding: .25rem .65rem; border: 1px solid var(--role-line); border-radius: 999px; color: var(--role-muted); font-size: .75rem; text-decoration: none; }
.role-role-switch a[aria-current="page"] { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); background: var(--accent-soft); }
.role-role-switch a:hover { border-color: var(--accent); color: var(--role-ink); }

.role-stage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.role-stage { display: flex; min-height: 0; flex-direction: column; align-items: center; padding: .45rem; text-align: center; }
.role-stage img { display: block; width: min(100%, 180px); height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.role-stage-copy { display: grid; gap: .2rem; padding: .25rem 0 .15rem; }
.role-stage-copy strong { font-size: .78rem; line-height: 1.25; }
.role-stage-level { color: var(--role-muted); font-size: .56rem; letter-spacing: .04em; }
.role-tabs { display: flex; width: fit-content; max-width: 100%; flex-wrap: wrap; gap: .25rem; margin: 1.1rem 0 .7rem; padding: .25rem; border: 1px solid var(--role-line); border-radius: 999px; background: #0b111d; }
.role-tab { min-width: 44px; min-height: 44px; padding: .25rem .9rem; border-color: transparent; background: transparent; color: var(--role-muted); font-size: .65rem; letter-spacing: .1em; }
.role-tab[aria-selected="true"] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--role-ink); }
.role-tab-panel { min-width: 0; }
.branch-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .45rem .8rem; margin-bottom: .7rem; }
.branch-heading h2 { margin: 0; font-size: 1.1rem; }
.branch-note { max-width: 55ch; margin: 0; color: var(--role-muted); font-size: .82rem; line-height: 1.45; }
.skill-track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.skill-node { display: flex; flex-direction: column; padding: .8rem .8rem .75rem 1rem; background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--role-card); }
.skill-node-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.skill-emoji { font-size: 1.15rem; }
.role-type, .role-chip { display: inline-flex; align-items: center; padding: .25rem .48rem; border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); border-radius: 999px; color: var(--accent); font-size: .56rem; letter-spacing: .1em; white-space: nowrap; }
.role-type.active { border-color: #f5b13d66; color: var(--role-amber); }
.skill-node > strong { margin: .5rem 0 .25rem; font-size: .96rem; line-height: 1.25; }
.skill-node p { margin: 0; color: var(--role-muted); font-size: .8rem; line-height: 1.42; }
.skill-cost { margin-top: .4rem; color: var(--role-amber); font-family: "JetBrains Mono", monospace; font-size: .66rem; }
.skill-ranks { margin-top: .55rem; padding-top: .5rem; border-top: 1px solid var(--role-line); }
.skill-ranks summary, .set-details summary, .technical-details summary, .faq-list summary, .role-faq summary, .roles-faq summary, .role-rule-box summary { color: var(--role-muted); font-size: .76rem; font-weight: 600; cursor: pointer; }
.rank-details { margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--role-line); }
.rank-details summary { color: var(--accent); font-size: .76rem; font-weight: 600; cursor: pointer; }
.rank-list { display: grid; gap: .35rem; margin: .55rem 0 0; padding: 0; list-style: none; }
.rank-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: .45rem; padding: .45rem; border-radius: .5rem; background: #101a2b; }
.rank-list strong { color: var(--role-muted); font-size: .58rem; letter-spacing: .04em; }
.rank-list span { color: var(--role-ink); font-size: .75rem; line-height: 1.45; }
.rank-list b { color: var(--role-muted); font-weight: 500; }

.set-grid, .elite-grid { display: grid; gap: .6rem; }
.set-card, .elite-card, .super-card { padding: .8rem .8rem .8rem 1rem; }
.set-card[data-deep-link="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 24px var(--accent-soft); }
.set-card-heading, .elite-card-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.role-chip.neutral { border-color: var(--role-line); color: var(--role-muted); }
.set-card h3, .elite-card h3, .super-card h3 { margin: .55rem 0 .35rem; }
.set-bonus, .elite-summary, .super-summary { margin: .35rem 0; color: var(--role-muted); font-size: .83rem; line-height: 1.48; }
.set-signature { margin: .55rem 0; padding: .55rem .65rem; border-left: 2px solid var(--accent); border-radius: 0 .5rem .5rem 0; background: var(--accent-soft); font-size: .82rem; line-height: 1.45; }
.set-book-note { margin: .4rem 0; color: var(--role-gold); font-size: .72rem; }
.set-footnote { margin: .4rem 0 0; color: var(--role-faint); font-size: .7rem; }
.set-card-actions { display: none; }
.set-details, .technical-details { margin-top: .55rem; padding-top: .5rem; border-top: 1px solid var(--role-line); }
.set-details p { margin: .45rem 0 0; color: var(--role-muted); font-size: .78rem; line-height: 1.45; }
.role-rule-box { margin: .6rem 0; padding: .65rem .8rem; color: var(--role-muted); font-size: .82rem; line-height: 1.5; }
.role-rule-box strong { color: var(--role-ink); }
.role-rule-box p { margin: .35rem 0; }
.elite-cost { margin: .4rem 0; color: var(--role-amber); font-family: "JetBrains Mono", monospace; font-size: .67rem; }
.super-card { margin-top: .7rem; border-color: color-mix(in srgb, var(--role-gold) 42%, var(--role-line)); background: radial-gradient(ellipse at 90% 0%, #d9b23f14, transparent 60%), var(--role-card); }
.super-card .role-chip { color: var(--role-gold); }
.super-facts { display: flex; flex-wrap: wrap; gap: .35rem; margin: .55rem 0; }
.super-facts span { padding: .3rem .48rem; border: 1px solid var(--role-line); border-radius: 999px; color: var(--role-ink); font-family: "JetBrains Mono", monospace; font-size: .62rem; }
.elite-card .technical-details { margin-top: .55rem; }
.technical-details code { display: block; margin-top: .35rem; overflow-wrap: anywhere; color: var(--role-faint); font-size: .68rem; }

.roles-faq, .role-faq { display: grid; gap: 0; padding: 0 .8rem; }
.roles-faq details, .role-faq details { padding: .65rem 0; border-top: 1px solid var(--role-line); }
.roles-faq details:first-child, .role-faq details:first-child { border-top: 0; }
.roles-faq summary, .role-faq summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: .75rem; list-style: none; }
.roles-faq summary::-webkit-details-marker, .role-faq summary::-webkit-details-marker { display: none; }
.roles-faq summary::after, .role-faq summary::after { flex: 0 0 1.5rem; color: var(--role-blue); content: "+"; text-align: center; }
.roles-faq details[open] summary::after, .role-faq details[open] summary::after { content: "−"; }
.skill-ranks summary, .rank-details summary, .set-details summary, .technical-details summary, .role-rule-box summary { display: flex; min-height: 44px; align-items: center; }
.roles-faq p, .role-faq p { max-width: 72ch; margin: .45rem 0 0; color: var(--role-muted); font-size: .82rem; line-height: 1.5; }
.roles-faq a, .role-faq a { color: var(--role-blue); }
.role-cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 1rem; background: linear-gradient(100deg, #f5b13d12, transparent 75%), var(--role-card); }
.role-cta-band h2 { margin: 0; font-size: 1.08rem; }
.role-cta-band p { margin: .25rem 0 0; color: var(--role-muted); font-size: .82rem; }
.snapshot-note { margin: 1rem 0 0; color: var(--role-faint); font-size: .6rem; letter-spacing: .08em; text-align: center; text-transform: none; }
.role-dialog { width: min(680px, calc(100vw - 28px)); max-width: 680px; max-height: min(84vh, 860px); padding: 1rem; overflow-y: auto; border: 1px solid var(--role-line); border-radius: .875rem; background: var(--role-card); color: var(--role-ink); box-shadow: 0 22px 90px #000a; }
.role-dialog::backdrop { background: #05070bc9; backdrop-filter: blur(5px); }
.dialog-close { position: sticky; z-index: 1; top: 0; float: right; width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 1.35rem; }
.dialog-body { clear: both; }
.dialog-body h2 { margin: .5rem 0; font-size: 1.45rem; }
.dialog-body p { color: var(--role-muted); line-height: 1.5; }
.dialog-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.copy-status { min-height: 1.4em; color: var(--role-ok); font-size: .8rem; }
.copy-helper { position: fixed; top: 0; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.roles-footer-note { margin-top: 1rem; text-align: center; }
.roles-footer-note a { color: var(--role-muted); }

@media (min-width: 640px) {
  .role-card { flex-direction: row; }
  .role-card-portrait { flex: 0 0 168px; width: 168px; min-height: 168px; }
  .role-card-portrait img { height: 168px; }
  .role-card-body { padding: .85rem 1rem; }
  .role-card p { margin: .35rem 0 .55rem; }
  .layer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-grid, .elite-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-page-hero { min-height: 104px; padding: .75rem 1rem; }
  .role-page-art { flex-basis: 88px; width: 88px; height: 88px; }
  .skill-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .roles-main { padding-top: 2.25rem; }
  .role-stage-grid { gap: .7rem; }
  .skill-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .role-stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .role-stage { padding: .4rem; }
  .role-stage img { width: min(100%, 160px); }
  .role-stage-copy strong { font-size: .67rem; }
  .role-stage-level { font-size: .48rem; letter-spacing: 0; }
  .role-page-art { flex-basis: 72px; width: 72px; height: 72px; }
  .role-page-hero { gap: .65rem; }
  .role-card-portrait { min-height: 136px; }
  .role-card-portrait img { height: 136px; }
  .skill-track { grid-template-columns: minmax(0, 1fr); }
  .role-cta-band { align-items: flex-start; }
}
@media (max-width: 380px) {
  .role-stage-grid { gap: .35rem; }
  .role-tabs { gap: .12rem; }
  .role-tab { min-width: 44px; padding-inline: .75rem; font-size: .58rem; }
  .role-page-art { flex-basis: 64px; width: 64px; height: 64px; }
  .role-card-portrait { min-height: 124px; }
  .role-card-portrait img { height: 124px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
