/* Tiles and the character card. Colors come from orrery.css. */
/* The portrait frame. It tilts. I keep the tilt on the frame so the image crop stays put. */
.stage { perspective: 1100px; }
.frame {
  --rx: 0deg; --ry: 0deg; --sx: 50%; --sy: 50%;
  position: relative; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .8s var(--ease);
}
.frame-media {
  position: relative; overflow: hidden;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px) saturate(1.25); backdrop-filter: blur(10px) saturate(1.25);
  box-shadow: var(--glass-highlight);
  border-radius: 14px;
}
.frame-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.2s var(--ease); }
.frame:hover .frame-media img { transform: scale(1.06); }
.frame-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background:
    linear-gradient(rgba(201, 166, 224, .08), transparent 40%),
    radial-gradient(circle at var(--sx) var(--sy), rgba(255,255,255,.14), transparent 45%);
}
.frame:hover .frame-media::after { opacity: 1; }
/* Corner brackets. Decoration. They don't catch clicks. */
.frame::after {
  content: ""; position: absolute; inset: -12px; pointer-events: none; transform: translateZ(30px);
  --c: color-mix(in oklab, var(--accent) 85%, white);
  background:
    linear-gradient(var(--c), var(--c)) left top / 22px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 1px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 22px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 1px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 22px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 1px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 22px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 1px 22px no-repeat;
  opacity: .85; transition: inset .6s var(--ease), opacity .6s;
}
.frame:hover::after { inset: -18px; opacity: 1; }
.ratio-1 { aspect-ratio: 1; }
.ratio-wide { aspect-ratio: 6 / 5; }
.ratio-tall { aspect-ratio: 3 / 4; }
.ratio-cinema { aspect-ratio: 16 / 10; }


/* Filter bar and the tile grid. */
.roster-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; margin-bottom: 44px; }
.roster-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filter {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text-3);
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  transition: color .25s, border-color .25s, background .25s, box-shadow .25s;
}
.filter::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .3; transition: opacity .3s; }
.filter:hover { color: var(--text-2); border-color: var(--glass-border); background: var(--glass-bg-soft); }
.filter[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--glass-border);
  background: color-mix(in oklab, var(--accent) 12%, var(--glass-bg-soft));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--glass-highlight);
}
.filter[aria-pressed="true"]::before { opacity: 1; }
.roster-tools {
  display: flex; flex-wrap: nowrap; align-items: flex-end; justify-content: flex-end;
  gap: 12px; margin-left: auto; min-height: 34px;
}
.roster-search { display: block; width: min(220px, 70vw); flex: none; }
.roster-search input {
  width: 100%; min-height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--glass-border); background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: var(--glass-highlight);
  color: var(--text); caret-color: var(--plasma);
  font: 500 13px/1.3 var(--body); outline: none;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.roster-search input::placeholder { color: var(--text-3); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.roster-search input:focus {
  border-color: color-mix(in oklab, var(--plasma) 50%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--plasma) 14%, transparent);
}
.roster-search input::-webkit-search-decoration,
.roster-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* Sort is a text button. I didn't want it looking like another role chip. */
.roster-sort {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 2px 0 0; cursor: pointer;
  border: 0; border-bottom: 1px solid color-mix(in oklab, var(--text-3) 55%, transparent);
  border-radius: 0; background: transparent; color: var(--text-3);
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  transition: color .25s, border-color .25s;
}
.roster-sort::after {
  content: ""; width: 0; height: 0;
  border-left: 3.5px solid transparent; border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor; opacity: .7;
  transition: transform .25s ease, opacity .25s;
}
.roster-sort:hover { color: var(--text); border-bottom-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.roster-sort[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.roster-sort[aria-pressed="true"]::after { transform: scaleY(-1); opacity: 1; }
.roster-count {
  order: -1; /* keep count left of search while bottom-aligned */
  margin: 0; padding: 0 0 2px; flex: none; align-self: flex-end; white-space: nowrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
  line-height: 1;
}

.roster-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: clamp(22px, 3vw, 40px) clamp(18px, 2.4vw, 32px);
}
.tile-wrap { animation: tileIn .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.tile-wrap.pop { animation-name: tileIn2; }
.tile-wrap[hidden] { display: none; }
.tile {
  display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
  font: inherit;
}
.tile .frame-media {
  background:
    radial-gradient(ellipse 80% 70% at 50% 30%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 70%),
    var(--nebula);
}
.tile .frame-media img, .tile .frame-media .emblem { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85) brightness(.92); transition: filter .6s, transform 1.2s var(--ease); }
.tile:hover .frame-media img, .tile:focus-visible .frame-media img { filter: none; }
.tile:focus-visible { outline: none; }
.tile .frame::after { display: none; }
.tile-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.tile-name { font-family: var(--display); font-weight: 400; font-size: 18px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.15; }
.tile-role { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.tile-role::before { content: ""; width: 14px; height: 1px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.tile:hover .tile-name { color: var(--accent); }

@keyframes tileIn { from { opacity: 0; filter: blur(8px); transform: perspective(900px) translate3d(0, 24px, -80px); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes tileIn2 { from { opacity: 0; filter: blur(8px); transform: perspective(900px) translate3d(0, 24px, -80px); } to { opacity: 1; filter: blur(0); transform: none; } }

/* The popup. Full screen on a phone, a panel on a desktop. */
.sheet {
  width: min(1180px, 94vw); max-width: none; max-height: min(90vh, 860px); padding: 0; margin: auto;
  border: 1px solid var(--glass-border); border-radius: 18px; background: var(--glass-bg-strong); color: var(--text); overflow: hidden;
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-shadow), var(--glass-highlight), 0 40px 140px -40px color-mix(in oklab, var(--accent) 35%, transparent);
}
.sheet::backdrop {
  background: color-mix(in oklab, var(--void) 62%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.25); backdrop-filter: blur(14px) saturate(1.25);
}
.sheet[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.sheet-art { position: relative; min-height: 420px; background: var(--nebula); overflow: hidden; border-right: 1px solid var(--line); }
.sheet-art img, .sheet-art .emblem { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; display: block; }
.sheet-art::after {
  content: ""; position: absolute; inset: 14px; pointer-events: none;
  --c: color-mix(in oklab, var(--accent) 85%, white);
  background:
    linear-gradient(var(--c), var(--c)) left top / 22px 1px no-repeat, linear-gradient(var(--c), var(--c)) left top / 1px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 22px 1px no-repeat, linear-gradient(var(--c), var(--c)) right top / 1px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 22px 1px no-repeat, linear-gradient(var(--c), var(--c)) left bottom / 1px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 22px 1px no-repeat, linear-gradient(var(--c), var(--c)) right bottom / 1px 22px no-repeat;
}
.sheet-body { overflow-y: auto; max-height: min(90vh, 860px); padding: clamp(24px, 3.4vw, 44px); }
.sheet-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.sheet-pos { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.sheet-btns { display: flex; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer; border-radius: var(--radius-hud, 2px);
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); transition: color .3s, border-color .3s, background .3s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); }
.icon-btn svg { width: 18px; height: 18px; }
.sheet-title { margin: 0 0 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.sheet-name { margin: 0 0 22px; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4.2vw, 54px); letter-spacing: .02em; text-transform: uppercase; line-height: .95; }
.sheet-chips { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-sm { display: inline-flex; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.chip-k { padding: 7px 10px; color: var(--text-3); border-right: 1px solid var(--line); }
.chip-v { padding: 7px 10px; color: var(--text); }
.sheet-bio { margin: 0 0 30px; color: var(--text-2); }
.sheet-h { margin: 0 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 12px; }
.sheet-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sheet-section { margin-bottom: 30px; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 28px; }
.stat { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 12px; }
.stat dt { font-size: 14px; color: var(--text-2); }
.stat dd { margin: 0; }
.stat-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.seg { height: 6px; background: color-mix(in oklab, var(--sable-bright) 12%, transparent); transform: skewX(-20deg); }
.seg.on { background: var(--accent); box-shadow: 0 0 10px color-mix(in oklab, var(--accent) 60%, transparent); }
.weapon { margin: 0; color: var(--text); }
.abilities { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ability { padding: 14px 16px; border: 1px solid var(--line); background: var(--deck-2); }
.ability.ult { border-color: color-mix(in oklab, var(--accent) 55%, transparent); background: color-mix(in oklab, var(--accent) 7%, var(--deck-2)); }
.ability-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.ability-slot { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.ability.ult .ability-slot { color: var(--accent); }
.ability-name { font-weight: 600; color: var(--text); }
.ability-text { margin: 0; font-size: 15px; color: var(--text-2); line-height: 1.55; }

/* Don't animate the art's transform. That wiped --art-scale and the model jumped to full size. */
.sheet.swap .sheet-body > * { animation: sheetIn .7s var(--ease) both; }
.sheet.swap:not(.card) .sheet-art > *:not(img):not(.emblem) { animation: sheetIn .7s var(--ease) both; }
.sheet.swap .sheet-body > :nth-child(2) { animation-delay: .04s; }
.sheet.swap .sheet-body > :nth-child(3) { animation-delay: .08s; }
.sheet.swap .sheet-body > :nth-child(n+4) { animation-delay: .12s; }
@keyframes sheetIn { from { opacity: 0; filter: blur(6px); transform: translate3d(0, 10px, 0) scale(.99); } to { opacity: 1; filter: blur(0); transform: none; } }

@media (max-width: 820px) {
  .sheet { width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; }
  .sheet[open] { grid-template-columns: 1fr; grid-template-rows: 42dvh 1fr; }
  .sheet-art { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .sheet-body { max-height: none; min-height: 0; }
  .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-name { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile-wrap { animation: none; }
}
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover .card-name { color: var(--accent); }


/* The sheet column. Art, the skin toggle, kit, lore. Empty fields get a placeholder. */
.sheet-art-col { position: relative; display: flex; flex-direction: column; min-height: 420px; border-right: 1px solid var(--line); background:
  radial-gradient(ellipse 70% 55% at 50% 45%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 70%), var(--nebula); }
.sheet-art-col .sheet-art { flex: 1; min-height: 0; border-right: 0; background: none; }
.sheet-art img, .sheet-art .emblem { object-fit: contain; object-position: 50% 100%; padding: clamp(12px, 2.4vw, 28px) clamp(12px, 2.4vw, 28px) 0; }
.sheet-art .emblem { padding: 0; object-fit: cover; }
.sheet-art.swap-art img, .sheet-art.swap-art .emblem { animation: sheetInArt .6s var(--ease) both; }
/* Fade only. A transform animation here overrides the art scale. */
@keyframes sheetInArt {
  from { opacity: 0; filter: blur(6px); }
  to { opacity: 1; filter: none; }
}
.looks {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 0 4px; border-top: 0; background: none;
}
.looks[hidden] { display: none; }
.looks-label { display: none; }
.look {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; cursor: pointer;
  border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--text-3);
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  transition: color .25s, border-color .25s, background .25s;
}
.look:hover { color: var(--text-2); }
.look[aria-pressed="true"] {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.looks.looks-toggle { padding: 2px 0 8px; }
.look-switch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 26px; padding: 0 4px 0 8px; cursor: pointer;
  border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--text-3);
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  transition: color .25s, border-color .25s, background .25s;
}
.look-switch:hover { color: var(--text-2); }
.look-switch[aria-pressed="true"] {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.look-switch-track {
  position: relative; width: 22px; height: 12px; border-radius: 999px; flex: none;
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .3s;
}
.look-switch-track::after {
  content: ""; position: absolute; top: 1.5px; left: 1.5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-3); transition: transform .3s var(--ease), background .3s;
}
.look-switch[aria-pressed="true"] .look-switch-track { background: color-mix(in oklab, var(--accent) 45%, transparent); }
.look-switch[aria-pressed="true"] .look-switch-track::after { transform: translateX(10px); background: var(--accent); }
.chip-v.tbd, .tile-role.tbd { color: var(--text-3); }
.passive { padding: 16px 18px; border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent); background: color-mix(in oklab, var(--accent) 6%, var(--deck-2)); }
.passive-name { display: block; margin-bottom: 4px; color: var(--text); font-weight: 600; }
.ability-variant { margin: 8px 0 0; font-size: 15px; color: var(--text-2); line-height: 1.55; }
.variant-label { display: inline-block; margin-right: 6px; padding: 1px 8px; border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent); color: var(--accent); font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.ability-details { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ability-details li { padding: 3px 9px; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--text-2); }
.abilities.ults .ability { border-color: color-mix(in oklab, var(--accent) 40%, transparent); }
.lore p { margin: 0 0 14px; color: var(--text-2); }
.lore p:last-child { margin-bottom: 0; }
.placeholder { list-style: none; display: inline-block; padding: 6px 12px; border: 1px dashed var(--line-strong); font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.lore .placeholder { margin: 0; }
@media (max-width: 820px) {
  .sheet[open] { grid-template-rows: 46dvh 1fr; }
  .sheet-art-col { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .looks { padding: 6px 0 2px; }
}


/* Attacks on the left, the character in the middle, abilities on the right.
   Ultimates sit with attacks. Passives go last under abilities. Lore runs along the bottom. */
.sheet.card {
  /* Kit colors stay inside the orbit palette. Sunset, purple, plasma. */
  --k-attacks: var(--sunset); --k-abilities: var(--sable-bright); --k-ultimates: var(--plasma);
  --k-lore: var(--light);
  width: min(1480px, 96vw); max-width: none; height: min(94vh, 1100px); max-height: none;
  padding: clamp(16px, 2vw, 28px); border-radius: 18px;
  /* visible x so wide models can bleed under kit columns */
  overflow-x: visible; overflow-y: auto; overscroll-behavior: contain;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1), transparent 28%),
    radial-gradient(ellipse 55% 42% at 50% 18%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 62%),
    radial-gradient(ellipse 40% 30% at 12% 88%, color-mix(in oklab, var(--sable-bright) 12%, transparent), transparent 70%),
    radial-gradient(ellipse 36% 28% at 88% 78%, color-mix(in oklab, var(--plasma) 10%, transparent), transparent 68%),
    var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-shadow), var(--glass-highlight), 0 0 120px -40px var(--plasma, var(--accent));
}
.sheet.card[open] { display: block; }
.sheet.card.is-swiping { will-change: transform, opacity; }
.card-tools {
  position: relative; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px;
  padding-bottom: 10px;
}
.card-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .82fr) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px); align-items: start;
  overflow: visible;
}
.card-col {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: clamp(28px, 3vw, 40px); min-width: 0;
  background: transparent;
}
.card-center {
  position: relative; z-index: 1; overflow: visible; min-width: 0;
}

.kit {
  --k: var(--k-attacks);
  position: relative; z-index: 2;
  padding: 0; border: 0; background: transparent; box-shadow: none;
}
.kit-abilities { --k: var(--k-abilities); }
.kit-ultimates { --k: var(--k-ultimates); }
.kit-lore { --k: var(--k-lore); margin-top: clamp(28px, 3vw, 40px); z-index: 3; }
/* Kit text sits on a tint so it stays readable when the art bleeds under it. */
.card-left .kit-head, .card-right .kit-head,
.card-left .kit-text, .card-right .kit-text,
.card-left .kit-variant, .card-right .kit-variant,
.card-left .kit-stats, .card-right .kit-stats,
.card-left .plate, .card-right .plate {
  text-shadow:
    0 0 10px color-mix(in oklab, var(--void) 88%, transparent),
    0 1px 2px color-mix(in oklab, var(--void) 70%, transparent);
}

.plate {
  display: flex; align-items: center; gap: 8px; margin: 0 0 2px; padding: 0 0 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--k) 45%, transparent);
  background: none; clip-path: none; text-shadow: none;
  font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--k);
}
.plate::before, .plate::after { content: none; }
.plate-text { font-size: 1em; letter-spacing: inherit; text-transform: inherit; }
.plate-icon { display: inline-grid; place-items: center; color: var(--k); background: none; box-shadow: none; }
.plate-icon svg { width: 15px; height: 15px; }

.kit-list { list-style: none; margin: 0; padding: 0; }
.kit-item { padding: 14px 0 12px; border-bottom: 1px solid rgba(247, 244, 251, .08); }
.kit-item:last-child { border-bottom: 0; }
.kit-head { margin: 0 0 4px; font-family: var(--body); font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--white); }
.kit-slot { color: var(--text-3); font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.kit-sep { margin: 0 8px; color: var(--text-3); font-weight: 400; }
.kit-name { color: var(--k); }
.kit-item .kit-head:only-child { margin: 0; }
.kit-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }
/* Marks in a kit sentence. Blue covers a condition, a boon, a resource, and another ability's name. */
.kw-blue { color: #9ec4ff; }
.kw-green { color: #7ed9a0; }
.kw-tan { color: #e0b48a; }
.kit-variant { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.kit-variant .variant-label { border-color: color-mix(in oklab, var(--k) 55%, transparent); color: var(--k); }
.kit-stats { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.kit-stats li { display: flex; gap: 6px; font-family: var(--body); font-size: 13.5px; font-weight: 500; letter-spacing: .01em; line-height: 1.45; color: var(--text); }
.stat-k { color: var(--text-3); font-weight: 600; }
.stat-k::after { content: ":"; }
.kit-list .placeholder { margin: 8px 0 0; }

.kit-lore .lore { padding: 12px 0 4px; columns: 2 380px; column-gap: 40px; }
.kit-lore .lore p { margin: 0 0 14px; break-inside: avoid; color: var(--text-2); line-height: 1.7; }

/* Middle column is the character. The art is allowed to spill under the side kits. */
.card-stage {
  position: sticky; top: 0; display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  overflow: visible;
}
.card-stage.has-fx { isolation: isolate; }
.card .sheet-art {
  position: relative; z-index: 0; height: min(62vh, 660px); border-radius: 0;
  overflow: visible; border: 0; background: none;
}
.card .sheet-art::after { display: none; }
.card .sheet-art img {
  /* wide bleed box, truly centered (left+right+width:auto is broken on replaced imgs) */
  top: 0; bottom: 0; left: 50%; right: auto;
  width: 204%; height: 100%; max-width: none;
  margin: 0 0 0 -102%;
  padding: 8px 0 0;
  object-fit: contain;
  object-position: var(--art-pos, 50% 100%);
  transform: scale(var(--art-scale, 1));
  transform-origin: bottom center;
  pointer-events: none;
}
.spotlight-fx,
.spotlight-fx-canvas {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  width: 100%; height: 100%; z-index: 2; pointer-events: none;
}
.spotlight-fx { overflow: hidden; }
/* Snow, drip, and aura paint above the name so they stay in that column. */
.card-stage.fx-snow .spotlight-fx-canvas,
.card-stage.fx-drip .spotlight-fx-canvas,
.card-stage.fx-aura .spotlight-fx-canvas,
.card-stage.fx-lightning .spotlight-fx-canvas { z-index: 4; }
/* Spores. --spore is the tint. Green if a character doesn't set one. */
.card-stage.fx-bioluminism { --spore: #7CFFB2; }
.spotlight-spores { position: absolute; inset: 0; pointer-events: none; }
.spotlight-spore {
  position: absolute; border-radius: 50%;
  background: var(--spore);
  box-shadow: 0 0 6px 1px color-mix(in oklab, var(--spore) 70%, transparent);
  opacity: 0; animation: sporeRise linear infinite;
  will-change: transform, opacity;
}
.spotlight-spore.is-still {
  opacity: .28; animation: none;
  box-shadow: 0 0 5px 1px color-mix(in oklab, var(--spore) 55%, transparent);
}
@keyframes sporeRise {
  0% { transform: translate(-50%, 0) scale(.65); opacity: 0; }
  10% { opacity: .42; }
  100% { transform: translate(calc(-50% + 18px), -70vh) scale(1); opacity: 0; }
}
.card-stage.fx-bioluminism .nameplate.spore-lit {
  box-shadow:
    inset 0 0 0 1px color-mix(in oklab, var(--spore) 28%, transparent),
    var(--glass-highlight),
    0 0 22px -10px color-mix(in oklab, var(--spore) 40%, transparent),
    0 -10px 28px -16px color-mix(in oklab, var(--spore) 22%, transparent);
}
.card-stage.fx-bioluminism .nameplate.spore-lit .sheet-name {
  text-shadow: 0 0 18px color-mix(in oklab, var(--spore) 32%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .spotlight-spore:not(.is-still) { animation: none !important; opacity: 0; }
}
.nameplate {
  /* plate top edge meets the art floor — feet rest on the boundary, not inside the card */
  position: relative; margin-top: -2px; padding: 14px 26px 16px; text-align: center; z-index: 3;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1), transparent 55%),
    var(--glass-bg-strong);
  clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 22px 100%, 0 50%);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 0 0 1px var(--glass-border), var(--glass-highlight);
}
.nameplate::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  clip-path: inherit; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 55%, transparent); }
.nameplate::after { content: ""; position: absolute; left: 30px; right: 30px; bottom: 6px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 10px var(--accent); }
.card .sheet-title { margin: 0 0 2px; font-size: 11px; }
.card .sheet-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(28px, 2.6vw, 40px); letter-spacing: .03em; text-transform: uppercase; color: var(--accent); text-shadow: 0 0 30px color-mix(in oklab, var(--accent) 45%, transparent); }
.role-pill { display: inline-flex; margin: 8px 0 0; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.role-v { padding: 4px 12px; color: var(--text); }
.role-v.tbd { color: var(--text-3); }
.card .looks { justify-content: center; border: 0; background: none; padding: 6px 0 2px; }
.card .looks.looks-toggle { padding: 2px 0 8px; }

.sheet.card.swap .kit, .sheet.card.swap .nameplate { animation: sheetIn .6s var(--ease) both; }
.sheet.card.swap .card-right .kit { animation-delay: .06s; }
.sheet.card.swap .kit-lore { animation-delay: .1s; }

/* Small screens. Character first, then each kit in order. */
@media (max-width: 960px) {
  .sheet.card { width: 100vw; height: 100dvh; border-radius: 0; padding: 14px; overflow: auto; }
  .sheet.card.is-swiping { overflow: hidden; touch-action: pan-x; }
  .card-grid { grid-template-columns: 1fr; }
  .card-col { display: contents; }
  .card-center { order: 0; }
  .kit-attacks { order: 1; } .kit-abilities { order: 2; } .kit-ultimates { order: 3; }
  .card-stage { position: relative; overflow: visible; }
  /*
    Same artScale framing as desktop: fixed “base” stage, scale from bottom.
    When artScale > 1, grow the stage so the taller model isn’t clipped
    (desktop uses overflow:visible; the mobile dialog can’t).
  */
  .card .sheet-art {
    height: calc(48vh * max(var(--art-scale, 1), 1));
    overflow: hidden;
  }
  .card .sheet-art img {
    top: auto; bottom: 0; left: 50%; right: auto;
    width: 204%; height: calc(100% / max(var(--art-scale, 1), 1));
    max-width: none; margin: 0 0 0 -102%; padding: 8px 0 0;
    transform: scale(var(--art-scale, 1));
    transform-origin: bottom center;
  }
}


.passive .kit-item { list-style: none; }
@keyframes tileIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes tileIn2 { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { opacity: 0; filter: blur(6px); transform: translate3d(0, 10px, 0) scale(.99); } to { opacity: 1; filter: blur(0); transform: none; } }
