/* Block headers (Admin > Appearance > Headers, setting `heads`, <html data-heads>). Slab is each skin's own title plate
   and has no rule here; the others replace it on every framed block (.card-head) and page title (.h-title; the
   character's and guild's heads keep theirs):
     tab     a tab hanging from the block's top edge, the title on it (the hero rail's cloth tabs on arcane)
     plaque  a plate set on the middle of the block's top edge, half out of it
     seal    a medallion before the title, a rule running on from it to the link to more
     flank   the title in the middle between two rules
     plain   the words alone, larger
   The drawn skins wear pieces from the art generator (heads/<skin>.py, build.py --heads) in img/ui/<skin>/heads/: most
   are cut in three, two ends and a middle that repeats (rounded to whole tiles, so its texture never stretches), and
   are laid on the title's ::before and ::after. Pictures are images; light and dye are masks white on clear, filled
   here with the accent (light) or with the colour as a dye under the picture that shades it (dye), so one set of files
   serves every colour, the custom one too. Modern and gilded draw theirs in CSS. Every rule sits under
   :root[data-heads] after a reset (all: unset) so no skin's title plate leaks into a style. */

/* ---------- the reset and what every style shares ---------- */
:root:not([data-heads='slab']) :is(.card-head, .card-head h2, .h-title:not(.char-head, .guild-head)),
:root:not([data-heads='slab']) :is(.card-head, .card-head h2, .h-title:not(.char-head, .guild-head))::before,
:root:not([data-heads='slab']) :is(.card-head, .card-head h2, .h-title:not(.char-head, .guild-head))::after { all: unset; }
:root:not([data-heads='slab']) :is(.card-head, .h-title:not(.char-head, .guild-head)) {
  --hd-ink: #ece9f3; --hd-top: calc(var(--frame-border) + 26px);
  display: flex; position: relative; align-items: center; gap: 14px; box-sizing: border-box; min-width: 0; margin: 0 0 20px;
  color: var(--hd-ink); font: 600 16px/1.25 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
}
:root:not([data-heads='slab']) .card-head h2 { display: block; position: relative; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
:root:not([data-heads='slab']) .card-head .card-more { flex: none; margin-left: auto; }
:root:not([data-heads='slab']) :is(.card-head, .h-title) .head-rune { display: none; }
/* a sliced layer: a pseudo element given its three pictures (--l, --m, --r) or three masks (--ml, --mm, --mr) and its
   ends' widths (--el, --er); one that is not given them shows nothing of them */
:root:not([data-heads='slab']) :is(.card-head, .card-head h2, .h-title:not(.char-head, .guild-head))::before,
:root:not([data-heads='slab']) :is(.card-head, .card-head h2, .h-title:not(.char-head, .guild-head))::after {
  box-sizing: border-box; padding: 0 var(--er, 0px) 0 var(--el, 0px); pointer-events: none;
  background-image: var(--l), var(--r), var(--m);
  background-size: var(--el) 100%, var(--er) 100%, auto 100%;
  background-position: left top, right top, left top;
  background-repeat: no-repeat, no-repeat, round no-repeat;
  background-origin: border-box, border-box, content-box;
  background-clip: border-box, border-box, content-box;
  -webkit-mask-image: var(--ml), var(--mr), var(--mm); mask-image: var(--ml), var(--mr), var(--mm);
  -webkit-mask-size: var(--el) 100%, var(--er) 100%, auto 100%; mask-size: var(--el) 100%, var(--er) 100%, auto 100%;
  -webkit-mask-position: left top, right top, left top; mask-position: left top, right top, left top;
  -webkit-mask-repeat: no-repeat, no-repeat, round no-repeat; mask-repeat: no-repeat, no-repeat, round no-repeat;
  -webkit-mask-origin: border-box, border-box, content-box; mask-origin: border-box, border-box, content-box;
  -webkit-mask-clip: border-box, border-box, content-box; mask-clip: border-box, border-box, content-box;
}
/* the title's rune where a style shows it (its skin's own stroke and glow) */
:root:not([data-heads='slab']) :is(.card-head, .h-title) .head-rune.is-shown,
:root:is([data-heads='tab'], [data-heads='seal'])[data-skin='arcane'] :is(.card-head, .h-title) .head-rune,
:root:is([data-heads='seal'])[data-skin='modern'] :is(.card-head, .h-title) .head-rune,
:root:is([data-heads='seal'])[data-skin='gilded'] :is(.card-head, .h-title) .head-rune,
:root[data-heads='flank'][data-skin='arcane'] :is(.card-head, .h-title) .head-rune {
  display: inline-block; flex: none; width: 10px; height: 15px; margin: 0 var(--hd-rune-gap, 0px) 0 0; overflow: visible; vertical-align: -2px;
  fill: none; stroke: var(--accent-hot); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 7px rgba(var(--accent-rgb), 0.6));
}
@keyframes hd-breathe { 0%, 100% { opacity: 0.85; } 35% { opacity: 0.6; } 60% { opacity: 1; } 80% { opacity: 0.72; } }

/* ---------- tab: hanging from the block's top edge, the link to more level with its title ---------- */
:root[data-heads='tab'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { align-items: flex-start; margin-top: calc(-1 * var(--hd-top)); margin-left: -8px; }
:root[data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  --el: 58px; --er: 22px; display: block; position: relative; flex: 0 1 auto; box-sizing: border-box; isolation: isolate;
  min-width: min(170px, 100%); max-width: 100%; height: 52px; padding: 0 24px 0 54px; overflow: hidden; line-height: 54px; text-overflow: ellipsis;
}
:root[data-heads='tab'] .h-title:not(.char-head, .guild-head) { width: fit-content; }
:root[data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before,
:root[data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::after { content: ''; position: absolute; inset: 0; z-index: -1; }
:root[data-heads='tab'] .card-head .card-more { margin-top: 20px; }
:root[data-heads='tab'] :is(.card-head, .h-title) .head-rune { position: absolute; left: 24px; top: 20px; }

/* ---------- plaque: on the middle of the top edge, half out of the block; the link to more under the edge ---------- */
:root[data-heads='plaque'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { justify-content: center; margin-top: calc(-1 * var(--hd-top) - 20px); margin-bottom: 18px; }
:root[data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  --el: 36px; --er: 36px; display: block; position: relative; flex: 0 1 auto; box-sizing: border-box; isolation: isolate;
  min-width: min(150px, 100%); max-width: calc(100% - 112px); height: 40px; padding: 0 34px; overflow: hidden; line-height: 41px; text-align: center; text-overflow: ellipsis;
}
:root[data-heads='plaque'] .h-title:not(.char-head, .guild-head) { width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; }
:root[data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before,
:root[data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::after { content: ''; position: absolute; inset: 0; z-index: -1; }
:root[data-heads='plaque'] .card-head .card-more { position: absolute; right: 0; bottom: -8px; }
/* a narrow block: the plaque takes the width and the link to more drops under it, at the right */
:root[data-heads='plaque'] .card-head:not(.char-head) { container-type: inline-size; }
@container (max-width: 400px) {
  :root[data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { max-width: 100%; }
  :root[data-heads='plaque'] .card-head:not(.char-head) .card-more { top: calc(100% + 3px); bottom: auto; }
}

/* ---------- seal: a medallion before the title, a rule from the title on to the link to more ---------- */
:root[data-heads='seal'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { gap: 12px; margin-bottom: 18px; }
:root[data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  display: block; position: relative; flex: 0 1 auto; box-sizing: border-box; isolation: isolate; min-width: 0; height: 52px; padding-left: 64px; line-height: 53px;
  background: var(--hd-seal) left center / 52px 52px no-repeat;
}
:root[data-heads='seal'] .h-title:not(.char-head, .guild-head) { display: flex; align-items: center; gap: 14px; }
:root[data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { content: ''; position: absolute; left: 0; top: 0; width: 52px; height: 52px; padding: 0; z-index: -1; }
:root[data-heads='seal'] :is(.card-head, .h-title) .head-rune { position: absolute; left: 21px; top: 18px; }
/* the rule: the header's ::before (between the title and more) or the page title's ::after */
:root[data-heads='seal'] .card-head:not(.char-head, .guild-head)::before, :root[data-heads='seal'] .h-title:not(.char-head, .guild-head)::after {
  --el: 28px; --er: 40px; content: ''; display: block; order: 1; flex: 1 1 0; min-width: 24px; height: 20px;
}
:root[data-heads='seal'] .card-head:not(.char-head) h2 { order: 0; }
:root[data-heads='seal'] .card-head .card-more { order: 2; margin-left: 0; }

/* ---------- flank: the title in the middle between two rules, the link to more after the right one ---------- */
:root[data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { --hd-rune-gap: 11px; justify-content: center; gap: 14px; margin-bottom: 22px; padding: 6px 0; }
:root[data-heads='flank'] .h-title:not(.char-head, .guild-head) .head-rune { order: 1; margin-right: -3px; }
:root[data-heads='flank'] .card-head:not(.char-head) h2 { order: 1; }
:root[data-heads='flank'] .card-head .card-more { order: 3; margin-left: 0; }
:root[data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after { --el: 28px; --er: 40px; content: ''; display: block; flex: 1 1 0; min-width: 18px; height: 20px; }
:root[data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before { order: 0; transform: scaleX(-1); }
:root[data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after { order: 2; }

/* a narrow block: the seal's rule and the flank's rules give way before the title is cut (they cannot be narrower
   than their two ends) */
:root:is([data-heads='seal'], [data-heads='flank']) .card-head:not(.char-head) { container-type: inline-size; }
@container (max-width: 400px) {
  :root[data-heads='seal'] .card-head:not(.char-head, .guild-head)::before { display: none; }
  :root[data-heads='seal'] .card-head:not(.char-head) .card-more { margin-left: auto; }
  :root[data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before { flex: 0 0 auto; width: 0; min-width: 0; padding: 0; visibility: hidden; }
  :root[data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after { flex: 1 1 0; min-width: 0; --er: 0px; }
}

/* ---------- plain: the words alone, larger ---------- */
:root[data-heads='plain'] :is(.card-head, .h-title:not(.char-head, .guild-head)) {
  align-items: baseline; justify-content: space-between; margin-bottom: 16px; font: 700 21px/1.25 var(--font-display); letter-spacing: 0.02em; text-transform: none;
}
:root[data-heads='plain'] .h-title:not(.char-head, .guild-head) { justify-content: flex-start; font-size: 28px; }
:root[data-heads='plain'] .card-head .card-more { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
:root[data-heads='plain'] .home-block.ui-align-center .card-head { justify-content: center; }

/* ======================= Arcane: the woven cloth, its dark stone, light in the accent ======================= */
:root[data-skin='arcane']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-ink: #e9e6f2; text-shadow: 0 1px 3px #000; }
:root[data-skin='arcane'][data-heads='tab'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { margin-top: calc(-1 * var(--hd-top) - 4px); }
:root[data-skin='arcane'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  --el: 80px; --er: 30px; min-width: min(260px, 100%); height: 68px; padding: 0 34px 0 70px; font-weight: 700; line-height: 70px; letter-spacing: 0.14em;
}
:root[data-skin='arcane'][data-heads='tab'] :is(.card-head, .h-title) .head-rune { left: 30px; top: 26px; width: 12px; height: 18px; stroke-width: 1.7; }
:root[data-skin='arcane'][data-heads='tab'] .card-head .card-more { margin-top: 30px; }
:root[data-skin='arcane'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before {
  --l: url("../img/ui/arcane/heads/tab_l.webp"); --m: url("../img/ui/arcane/heads/tab_m.webp"); --r: url("../img/ui/arcane/heads/tab_r.webp");
}
:root[data-skin='arcane'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::after {
  --ml: url("../img/ui/arcane/heads/tab_lit_l.webp"); --mm: url("../img/ui/arcane/heads/tab_lit_m.webp"); --mr: url("../img/ui/arcane/heads/tab_lit_r.webp");
  background-color: var(--accent-hot); animation: hd-breathe 5s ease-in-out infinite;
}
:root[data-skin='arcane'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before {
  --l: url("../img/ui/arcane/heads/plaque_l.webp"); --m: url("../img/ui/arcane/heads/plaque_m.webp"); --r: url("../img/ui/arcane/heads/plaque_r.webp");
}
:root[data-skin='arcane'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::after {
  --ml: url("../img/ui/arcane/heads/plaque_lit_l.webp"); --mm: url("../img/ui/arcane/heads/plaque_lit_m.webp"); --mr: url("../img/ui/arcane/heads/plaque_lit_r.webp");
  background-color: var(--accent-hot); animation: surge 3.2s ease-in-out infinite;
}
:root[data-skin='arcane'][data-heads='seal'] :is(.card-head, .h-title) { --hd-seal: url("../img/ui/arcane/heads/seal.webp"); }
:root[data-skin='arcane'][data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before {
  background: var(--accent-hot); -webkit-mask: url("../img/ui/arcane/heads/seal_lit.webp") center / 100% 100% no-repeat; mask: url("../img/ui/arcane/heads/seal_lit.webp") center / 100% 100% no-repeat;
  animation: surge 3.2s ease-in-out infinite;
}
:root[data-skin='arcane'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='arcane'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after,
:root[data-skin='arcane'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='arcane'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after {
  --ml: url("../img/ui/arcane/heads/rule_l.webp"); --mm: url("../img/ui/arcane/heads/rule_m.webp"); --mr: url("../img/ui/arcane/heads/rule_r.webp");
  background-color: var(--accent-hot);
}
:root[data-skin='arcane'][data-heads='plain'] :is(.card-head, .h-title) { text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.45), 0 1px 2px #000; }

/* ======================= Parchment: dyed silk, vellum, gold leaf and ink on the paper ======================= */
:root[data-skin='parchment']:not([data-heads='slab']) :is(.card-head, .h-title) {
  --hd-ink: #2b1c0e; --hd-top: 40px; --hd-dye: color-mix(in srgb, var(--accent) 47%, #120a05); font-weight: 700; text-shadow: none;
}
:root[data-paper='hanging'][data-skin='parchment']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-top: 20px; }
:root[data-skin='parchment']:not([data-heads='slab']) .card-head .card-more { color: rgba(58, 36, 18, 0.72); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.14em; }
:root[data-skin='parchment']:not([data-heads='slab']) .card-head .card-more:hover { color: #2b1a0b; }
/* the tab: ivory letters on the silk, the silk's dye under its shading and stitches */
:root[data-skin='parchment'][data-heads='tab'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { --hd-ink: #f6ecd6; margin-top: calc(-1 * var(--hd-top) - 4px); }
:root[data-skin='parchment'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { --el: 40px; --er: 24px; height: 50px; padding: 0 22px 0 38px; line-height: 56px; letter-spacing: 0.14em; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); }
:root[data-skin='parchment'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { --ml: url("../img/ui/parchment/heads/tab_dye_l.webp"); --mm: url("../img/ui/parchment/heads/tab_dye_m.webp"); --mr: url("../img/ui/parchment/heads/tab_dye_r.webp"); background-color: var(--hd-dye); }
:root[data-skin='parchment'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::after { --l: url("../img/ui/parchment/heads/tab_l.webp"); --m: url("../img/ui/parchment/heads/tab_m.webp"); --r: url("../img/ui/parchment/heads/tab_r.webp"); }
:root[data-skin='parchment'][data-heads='tab'] .card-head .card-more { margin-top: 22px; }
/* the plaque: a vellum label, ink letters */
:root[data-skin='parchment'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { --el: 32px; --er: 32px; padding: 0 30px; line-height: 39px; letter-spacing: 0.14em; }
:root[data-skin='parchment'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { --l: url("../img/ui/parchment/heads/plaque_l.webp"); --m: url("../img/ui/parchment/heads/plaque_m.webp"); --r: url("../img/ui/parchment/heads/plaque_r.webp"); }
/* the seal: the wax's dye under the h2 (outside its own layer, so the picture on the h2 shades it) */
:root[data-skin='parchment'][data-heads='seal'] :is(.card-head, .h-title) { --hd-seal: url("../img/ui/parchment/heads/seal.webp"); }
:root[data-skin='parchment'][data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { isolation: auto; }
:root[data-skin='parchment'][data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { background: var(--hd-dye); -webkit-mask: url("../img/ui/parchment/heads/seal_dye.webp") center / 100% 100% no-repeat; mask: url("../img/ui/parchment/heads/seal_dye.webp") center / 100% 100% no-repeat; }
:root[data-skin='parchment'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='parchment'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after,
:root[data-skin='parchment'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='parchment'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after { --l: url("../img/ui/parchment/heads/rule_l.webp"); --m: url("../img/ui/parchment/heads/rule_m.webp"); --r: url("../img/ui/parchment/heads/rule_r.webp"); }
:root[data-skin='parchment'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { letter-spacing: 0.14em; }
:root[data-skin='parchment'][data-heads='plain'] :is(.card-head, .h-title) { letter-spacing: 0.04em; }

/* ======================= Living vines: moss-woven cloth, chrome, vines with buds of light ======================= */
:root[data-skin='vine_live']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-ink: #eef2ec; text-shadow: 0 1px 3px #000; }
:root[data-skin='vine_live'][data-heads='tab'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { margin-top: calc(-1 * var(--hd-top) - 3px); }
:root[data-skin='vine_live'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  --el: 80px; --er: 30px; min-width: min(260px, 100%); height: 68px; padding: 0 34px 0 70px; font-weight: 700; line-height: 76px; letter-spacing: 0.14em;
}
:root[data-skin='vine_live'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { --l: url("../img/ui/vine_live/heads/tab_l.webp"); --m: url("../img/ui/vine_live/heads/tab_m.webp"); --r: url("../img/ui/vine_live/heads/tab_r.webp"); }
:root[data-skin='vine_live'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::after { --ml: url("../img/ui/vine_live/heads/tab_lit_l.webp"); --mm: url("../img/ui/vine_live/heads/tab_lit_m.webp"); --mr: url("../img/ui/vine_live/heads/tab_lit_r.webp"); background-color: var(--accent-hot); animation: hd-breathe 6s ease-in-out infinite; }
:root[data-skin='vine_live'][data-heads='tab'] .card-head .card-more { margin-top: 32px; }
:root[data-skin='vine_live'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { --el: 44px; --er: 44px; padding: 0 40px; }
:root[data-skin='vine_live'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { --l: url("../img/ui/vine_live/heads/plaque_l.webp"); --m: url("../img/ui/vine_live/heads/plaque_m.webp"); --r: url("../img/ui/vine_live/heads/plaque_r.webp"); }
:root[data-skin='vine_live'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::after { --ml: url("../img/ui/vine_live/heads/plaque_lit_l.webp"); --mm: url("../img/ui/vine_live/heads/plaque_lit_m.webp"); --mr: url("../img/ui/vine_live/heads/plaque_lit_r.webp"); background-color: var(--accent-hot); animation: hd-breathe 6s ease-in-out infinite; }
:root[data-skin='vine_live'][data-heads='seal'] :is(.card-head, .h-title) { --hd-seal: url("../img/ui/vine_live/heads/seal.webp"); }
:root[data-skin='vine_live'][data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before {
  background: var(--accent-hot); -webkit-mask: url("../img/ui/vine_live/heads/seal_lit.webp") center / 100% 100% no-repeat; mask: url("../img/ui/vine_live/heads/seal_lit.webp") center / 100% 100% no-repeat;
  animation: hd-breathe 6s ease-in-out infinite;
}
:root[data-skin='vine_live'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='vine_live'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after,
:root[data-skin='vine_live'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='vine_live'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after { --l: url("../img/ui/vine_live/heads/rule_l.webp"); --m: url("../img/ui/vine_live/heads/rule_m.webp"); --r: url("../img/ui/vine_live/heads/rule_r.webp"); }

/* ---------- arcane and living vines at full size: their plaque, seal and rules drawn 1.25 times larger ---------- */
:root:is([data-skin='arcane'], [data-skin='vine_live'])[data-heads='plaque'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { margin-top: calc(-1 * var(--hd-top) - 25px); }
:root[data-skin='arcane'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { --el: 45px; --er: 45px; height: 50px; padding: 0 42px; font-weight: 700; line-height: 51px; letter-spacing: 0.14em; }
:root[data-skin='vine_live'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { --el: 55px; --er: 55px; height: 50px; padding: 0 50px; font-weight: 700; line-height: 51px; letter-spacing: 0.14em; }
:root:is([data-skin='arcane'], [data-skin='vine_live'])[data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { height: 66px; padding-left: 80px; font-weight: 700; line-height: 67px; letter-spacing: 0.14em; background-size: 66px 66px; }
:root:is([data-skin='arcane'], [data-skin='vine_live'])[data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { width: 66px; height: 66px; }
:root:is([data-skin='arcane'], [data-skin='vine_live'])[data-heads='seal'] :is(.card-head, .h-title) .head-rune { left: 27px; top: 24px; width: 12px; height: 18px; stroke-width: 1.7; }
:root[data-skin='arcane'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='arcane'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after,
:root[data-skin='arcane'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='arcane'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after,
:root[data-skin='vine_live'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='vine_live'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after,
:root[data-skin='vine_live'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='vine_live'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after { --el: 35px; --er: 50px; height: 25px; }
:root:is([data-skin='arcane'], [data-skin='vine_live'])[data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { font-weight: 700; letter-spacing: 0.14em; }
:root[data-skin='arcane'][data-heads='flank'] :is(.card-head, .h-title) .head-rune { width: 12px; height: 18px; }

/* ======================= Modern: glass, hairlines, the accent ======================= */
:root[data-skin='modern']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-ink: #fff; --hd-top: 27px; }
:root[data-skin='modern'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  height: 54px; padding: 0 30px; line-height: 56px; border-radius: 0 0 16px 16px; min-width: min(200px, 100%); font-weight: 700;
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1), inset 1px 0 0 rgba(255, 255, 255, 0.06), inset -1px 0 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
:root[data-skin='modern'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { inset: 0 10px auto; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); box-shadow: 0 0 12px 1px rgba(var(--accent-rgb), 0.7); }
:root[data-skin='modern'][data-heads='tab'] .card-head .card-more { margin-top: 21px; }
:root[data-skin='modern'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  height: 46px; padding: 0 34px; line-height: 47px; border-radius: 99px; font-weight: 700;
  background: rgba(14, 15, 20, 0.82); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.55), 0 0 18px -4px rgba(var(--accent-rgb), 0.55);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
:root[data-skin='modern'][data-heads='plaque'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { margin-top: calc(-1 * var(--hd-top) - 23px); }
:root[data-skin='modern'][data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { height: 54px; padding-left: 68px; line-height: 55px; background: none; }
:root[data-skin='modern'][data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before {
  width: 52px; height: 52px; top: 1px; border-radius: 50%; background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.6), inset 0 0 14px rgba(var(--accent-rgb), 0.25), 0 0 16px -4px rgba(var(--accent-rgb), 0.6);
}
:root[data-skin='modern'][data-heads='seal'] :is(.card-head, .h-title) .head-rune { left: 20px; top: 17px; width: 12px; height: 18px; }
:root[data-skin='modern'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='modern'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after,
:root[data-skin='modern'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='modern'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after { height: 1px; padding: 0; }
:root[data-skin='modern'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='modern'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after,
:root[data-skin='modern'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='modern'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-rgb), 0.25) 40%, transparent);
  box-shadow: none;
}
:root[data-skin='modern'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='modern'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after {
  height: 5px; background: radial-gradient(circle at 2.5px 50%, var(--accent-hot) 0 2px, transparent 2.6px), linear-gradient(90deg, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-rgb), 0.2) 50%, transparent) 0 2px / 100% 1px no-repeat;
}
:root[data-skin='modern'][data-heads='plain'] :is(.card-head, .h-title) { text-shadow: none; }

/* ======================= Gilded: its warm panels in the colour's hue, the colour as gold ======================= */
:root[data-skin='gilded']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-ink: #fff; --hd-top: 27px; font-family: var(--font-display); }
:root[data-skin='gilded'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  height: 54px; padding: 0 30px; line-height: 56px; border-radius: 0 0 14px 14px; min-width: min(200px, 100%); letter-spacing: 0.06em; font-weight: 700;
  background: var(--gd-panel-hi); box-shadow: inset 0 -1px 0 var(--gd-edge), inset 1px 0 0 var(--gd-edge), inset -1px 0 0 var(--gd-edge), 0 12px 22px -16px rgba(0, 0, 0, 0.9);
}
:root[data-skin='gilded'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before { inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--gd-gold), var(--gd-gold-hi), var(--gd-gold)); }
:root[data-skin='gilded'][data-heads='tab'] .card-head .card-more { margin-top: 12px; }
:root[data-skin='gilded'][data-heads='plaque'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) {
  height: 46px; padding: 0 34px; line-height: 47px; border-radius: 99px; letter-spacing: 0.08em; font-weight: 700;
  background: var(--gd-chip-hi); box-shadow: inset 0 0 0 1px var(--gd-gold), 0 10px 20px -12px rgba(0, 0, 0, 0.9);
}
:root[data-skin='gilded'][data-heads='plaque'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { margin-top: calc(-1 * var(--hd-top) - 23px); }
:root[data-skin='gilded'][data-heads='plaque'] .card-head .card-more { bottom: -14px; }
:root[data-skin='gilded'][data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { height: 54px; padding-left: 68px; line-height: 55px; background: none; }
:root[data-skin='gilded'][data-heads='seal'] :is(.card-head h2, .h-title:not(.char-head, .guild-head))::before {
  width: 52px; height: 52px; top: 1px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gd-chip-hi), var(--gd-deep));
  box-shadow: inset 0 0 0 1.5px var(--gd-gold), inset 0 0 0 4px var(--gd-deep), inset 0 0 0 5px color-mix(in srgb, var(--gd-gold) 45%, transparent);
}
:root[data-skin='gilded'][data-heads='seal'] :is(.card-head, .h-title) .head-rune { left: 20px; top: 17px; width: 12px; height: 18px; stroke: var(--gd-gold-hi); filter: none; }
:root[data-skin='gilded'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='gilded'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after,
:root[data-skin='gilded'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='gilded'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after { height: 1px; padding: 0; }
:root[data-skin='gilded'][data-heads='seal'] .card-head:not(.char-head)::before, :root[data-skin='gilded'][data-heads='seal'] .h-title:not(.char-head, .guild-head)::after { background: linear-gradient(90deg, var(--gd-gold), color-mix(in srgb, var(--gd-gold) 20%, transparent) 45%, transparent); }
:root[data-skin='gilded'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::before,
:root[data-skin='gilded'][data-heads='flank'] :is(.card-head, .h-title:not(.char-head, .guild-head))::after {
  height: 7px; background: radial-gradient(circle at 3.5px 50%, var(--gd-gold) 0 2.6px, transparent 3.2px), linear-gradient(90deg, var(--gd-gold), color-mix(in srgb, var(--gd-gold) 15%, transparent) 60%, transparent) 0 3px / 100% 1px no-repeat;
}
:root[data-skin='gilded'][data-heads='flank'] :is(.card-head, .h-title) { letter-spacing: 0.08em; }
:root[data-skin='gilded'][data-heads='plain'] :is(.card-head, .h-title) { text-shadow: none; }

/* ---------- the tab runs the block's full width: a band across its top edge to edge, the title at its left, the link
   to more inside it at its right (--hd-side: from the content to the block's visible edge) ---------- */
:root:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: calc(var(--frame-border) + 30px); }
:root[data-skin='parchment']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: 44px; }
:root[data-paper='hanging'][data-skin='parchment']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: 20px; }
:root[data-skin='modern']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: 31px; }
:root[data-skin='gilded']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: 29px; }
:root[data-heads='tab'] :is(.card-head, .h-title:not(.char-head, .guild-head)):not(.guild-head) { margin-left: calc(-1 * var(--hd-side)); margin-right: calc(-1 * var(--hd-side)); }
:root[data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)):not(.guild-head) { flex: 1 1 auto; width: auto; min-width: 0; max-width: none; }
:root[data-heads='tab'] .card-head:not(.char-head, .guild-head):not(.h-title) h2 { padding-right: calc(var(--er, 22px) + 70px); }
:root[data-heads='tab'] .card-head:not(.char-head) .card-more { position: absolute; top: 0; right: calc(var(--er, 22px) + 8px); margin: 0; line-height: 54px; }
:root[data-skin='arcane'][data-heads='tab'] .card-head:not(.char-head) .card-more { line-height: 70px; }
:root[data-skin='vine_live'][data-heads='tab'] .card-head:not(.char-head) .card-more { line-height: 76px; }
:root:is([data-skin='arcane'], [data-skin='vine_live'])[data-heads='tab'] .card-head:not(.char-head) .card-more { color: rgba(240, 238, 246, 0.72); font-weight: 600; text-shadow: 0 1px 3px #000; }
:root:is([data-skin='arcane'], [data-skin='vine_live'])[data-heads='tab'] .card-head:not(.char-head) .card-more:hover { color: #fff; }
:root[data-skin='parchment'][data-heads='tab'] .card-head:not(.char-head) .card-more { line-height: 56px; color: rgba(246, 236, 214, 0.78); }
:root[data-skin='parchment'][data-heads='tab'] .card-head:not(.char-head) .card-more:hover { color: #fff8e8; }
:root:is([data-skin='modern'], [data-skin='gilded'])[data-heads='tab'] .card-head:not(.char-head) .card-more { line-height: 56px; right: 24px; }
:root[data-skin='gilded'][data-heads='tab'] .card-head:not(.char-head) .card-more { top: 12px; line-height: normal; }
:root[data-skin='modern'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)):not(.guild-head) { border-radius: 17px 17px 0 0; }
:root[data-skin='gilded'][data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)):not(.guild-head) { border-radius: 11px 11px 0 0; }

@media (max-width: 560px) {
  :root:not([data-heads='slab']) :is(.card-head, .h-title:not(.char-head, .guild-head)) { --hd-top: calc(var(--frame-border) + 18px); gap: 10px; }
  :root[data-skin='modern']:not([data-heads='slab']) :is(.card-head, .h-title), :root[data-skin='gilded']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-top: 19px; }
  :root[data-skin='parchment']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-top: 30px; }
  :root[data-paper='hanging'][data-skin='parchment']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-top: 8px; }
  :root[data-heads='tab'] :is(.card-head h2, .h-title:not(.char-head, .guild-head)) { min-width: 0; }
  :root:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: calc(var(--frame-border) + 10px); }
  :root[data-skin='parchment']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: 22px; }
  :root[data-paper='hanging'][data-skin='parchment']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: 8px; }
  :root[data-skin='modern']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: 11px; }
  :root[data-skin='gilded']:not([data-heads='slab']) :is(.card-head, .h-title) { --hd-side: 17px; }
  :root[data-heads='plain'] :is(.card-head, .h-title:not(.char-head, .guild-head)) { font-size: 18px; }
  :root[data-heads='plain'] .h-title:not(.char-head, .guild-head) { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-heads='slab']) :is(.card-head, .card-head h2, .h-title)::before, :root:not([data-heads='slab']) :is(.card-head, .card-head h2, .h-title)::after { animation: none !important; }
}
