/* BrawlHood — /fighters select screen (DESIGN.md §5). Extends tokens.css + site.css; never redefines their names. */

.fighters-page { padding-top: var(--space-6); padding-bottom: var(--space-8); display: flex; flex-direction: column; gap: var(--space-5); }
.page-head { display: flex; flex-direction: column; gap: var(--space-2); }
.page-head .lede { margin: var(--space-1) 0 0; }

/* =========================================================== filter bar */
.filterbar { padding: var(--space-3) var(--space-4); }
.filterbar__row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.filterbar__search { flex: 1 1 220px; min-width: 180px; display: block; }
.filterbar__search .input { height: 40px; }
.filterbar__sort .input { width: auto; min-width: 170px; }
.filterbar .toggle { min-height: 40px; }
.filterbar .toolbar-count { white-space: nowrap; }
.filterbar .chip .swatch { flex: none; }
.filterbar__scroll { min-width: 0; max-width: 100%; }
.filterbar__scroll::before, .filterbar__scroll::after { width: var(--space-5); }
@media (max-width: 719px) {
  .filterbar__row { gap: var(--space-2); }
  .filterbar__search { flex-basis: 100%; }
  .filterbar__sort { flex: 1 1 auto; }
  .filterbar__sort .input { width: 100%; }
  .filterbar__scroll { flex-basis: 100%; margin: 0 calc(-1 * var(--space-4)); max-width: none; }
  .filterbar__scroll .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px var(--space-4); gap: var(--space-2); }
  .filterbar__scroll .chips::-webkit-scrollbar { display: none; }
  .filterbar .chip { height: var(--target); flex: none; }
  .filterbar .toggle { min-height: var(--target); }
  .filterbar .toolbar-count { flex-basis: 100%; margin-left: 0; }
}

/* =========================================================== stage row */
.stage-row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--grid-gap); align-items: start; }
.stage-row > *, .stage-side > * { min-width: 0; }
.stage-side { display: flex; flex-direction: column; gap: var(--space-4); }

.stage { position: relative; min-height: 600px; background: var(--bg-0); overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.stage.no-webgl canvas { display: none; }
.stage__fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--space-6); }
.stage__fallback .empty { border: 0; background: transparent; }
.stage__hud { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--space-4); }
.stage__hint { position: absolute; top: var(--space-4); right: var(--space-4); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); background: rgba(8, 8, 10, 0.72); border: 1px solid var(--line-1); color: var(--ink-2); font-size: var(--text-small); }
.stage__plate { align-self: flex-start; max-width: min(100%, 420px); pointer-events: auto; }
.stage__plate .nameplate--overlay { padding: var(--space-3) var(--space-4); }
.stage__plate .nameplate__meta .pill { margin-left: var(--space-1); }
.stage__controls { display: flex; gap: var(--space-1); flex-wrap: wrap; justify-content: flex-end; margin-top: var(--space-3); pointer-events: auto; }
.stage__controls .btn { background: rgba(8, 8, 10, 0.72); border-color: var(--line-1); color: var(--ink-1); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.stage__controls .btn:hover { background: var(--bg-3); border-color: var(--line-2); }
.stage__controls .btn:disabled { opacity: 0.45; }
.stage.is-error .stage__controls { display: none; }
@media (min-width: 1200px) {
  .stage { position: sticky; top: calc(var(--topbar-h) + var(--banner-h) + var(--space-4)); }
}
@media (max-width: 1199px) {
  .stage-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stage { min-height: 520px; }
}
@media (max-width: 719px) {
  .stage-row { grid-template-columns: 1fr; gap: var(--space-4); }
  .stage-side { display: contents; }
  .wallet { order: -1; }
  .stage { min-height: 0; aspect-ratio: 4 / 5; }
  .stage__controls .btn { min-height: var(--target); flex: 1 1 auto; }
  .stage__hint { display: none; }
  .stage__plate { max-width: 100%; }
}

/* =========================================================== wallet bar */
.wallet { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); min-height: 88px; }
.wallet__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.wallet__main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; flex: 1 1 220px; }
.wallet__title { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-weight: 600; }
.wallet__title .icon { width: 18px; height: 18px; color: var(--ink-3); }
.wallet__title .mono { color: var(--ink-1); }
.wallet__text { font-size: var(--text-small); color: var(--ink-2); }
.wallet__actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.wallet__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.wallet__stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wallet__stat-label { font-size: var(--text-micro); text-transform: uppercase; letter-spacing: var(--tracking-micro); font-weight: 600; color: var(--ink-3); }
.wallet__stat-value { font-family: var(--font-display); font-size: 24px; line-height: 1; letter-spacing: 0.02em; color: var(--ink-1); display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.wallet__stat-value small { font-family: var(--font-body); font-size: var(--text-small); letter-spacing: 0; color: var(--ink-3); }
.wallet__claims { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-small); color: var(--ink-3); }
.wallet__claims .chip { cursor: default; padding-right: var(--space-2); }
.wallet__claims .chip a { color: var(--ink-1); font-weight: 600; }
.wallet__claims .chip a:hover { text-decoration: none; color: var(--gold); }
.wallet__note { font-size: var(--text-small); color: var(--ink-3); margin: 0; }
.wallet__error { font-size: var(--text-small); color: var(--bad); font-weight: 500; }
@media (max-width: 479px) { .wallet__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================================================== fighter sheet */
.sheet { display: flex; flex-direction: column; gap: var(--space-4); min-height: 640px; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-3); flex-wrap: wrap; }
.sheet__plate { min-width: 0; flex: 1 1 260px; }
.sheet__status { flex: none; padding-top: var(--space-1); }
.pill .addr { text-transform: none; letter-spacing: 0.02em; font-family: var(--font-mono); }
.sheet__charts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-4); align-items: start; }
.sheet__radar .chart__body svg { max-width: 260px; }
.sheet__rings { display: flex; flex-direction: column; gap: var(--space-2); width: 150px; }
.sheet__rings .chart__body svg { max-width: 120px; }
.sheet__rings .chart__title { font-size: var(--text-small); }
.sheet__rings .chart__note { line-height: 1.3; }
.sheet__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.sheet__facts .tile { min-height: 0; }
.sheet__facts .tile__value { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.sheet__facts .tile__sub { flex-wrap: wrap; row-gap: 2px; }
.sheet__facts .result-dots { margin-left: 2px; }
.sheet__skeleton { display: flex; flex-direction: column; gap: var(--space-3); }
.sheet__skeleton-row { display: flex; gap: var(--space-3); align-items: center; }
.sheet__skeleton-row .skeleton--ring { width: 120px; height: 120px; }
.sheet__skeleton-row .skeleton--tile { flex: 1; }

/* claim block */
.sheet__claim { display: flex; flex-direction: column; gap: var(--space-3); margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--line-1); }
.claim__round { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-small); color: var(--ink-2); }
.claim__round strong { color: var(--ink-1); font-variant-numeric: tabular-nums; }
.claim__round .num { color: var(--ink-1); }
.claim__need { font-size: var(--text-small); color: var(--ink-2); }
.claim__need.ok { color: var(--ok); }
.claim__need.bad { color: var(--warn); }
.claim__actions { display: flex; flex-direction: column; gap: var(--space-2); }
.claim__actions .btn { width: 100%; }
.claim__reason { font-size: var(--text-small); color: var(--ink-3); }
.claim__renew { align-items: flex-start; }
.claim__renew .toggle__track { margin-top: 2px; }
.claim__renew span:last-child { line-height: 1.4; }
.claim__free { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-small); color: var(--ink-3); }
.claim__free .icon { width: 14px; height: 14px; margin-top: 3px; flex: none; }
/* mobile sticky CTA: a compact mirror of the claim button, pinned to the viewport bottom while the sheet is in view,
   hidden while the real claim block is on screen (DESIGN §8.11) */
.sheet__cta { display: none; }
@media (max-width: 719px) {
  .sheet { min-height: 0; }
  .sheet__charts { grid-template-columns: 1fr; }
  .sheet__rings { flex-direction: row; width: auto; }
  .sheet__rings > div { flex: 1; }
  .sheet__cta { display: flex; align-items: center; gap: var(--space-3); position: sticky; bottom: 0; z-index: 3; margin: 0 -20px -20px; padding: var(--space-3) 20px; background: var(--bg-2); border-top: 1px solid var(--line-1); border-radius: 0 0 var(--radius-2) var(--radius-2); box-shadow: 0 -8px 16px rgba(8, 8, 10, 0.5); transition: opacity var(--dur-2) var(--ease), visibility var(--dur-2); }
  .sheet__cta.is-hidden { opacity: 0; visibility: hidden; }
  .sheet__cta[hidden] { display: none; }
  .sheet__cta-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .sheet__cta-name { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.04em; line-height: 1; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet__cta-price { font-size: var(--text-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .sheet__cta .btn { flex: none; min-height: var(--target); }
}

/* =========================================================== tale of the tape */
.tape { padding: 0; }
.tape summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 20px; min-height: var(--target); cursor: pointer; list-style: none; }
.tape summary::-webkit-details-marker { display: none; }
.tape summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform var(--dur-2) var(--ease); flex: none; margin-right: 4px; }
.tape[open] summary::after { transform: rotate(-135deg); }
.tape summary:focus-visible { box-shadow: inset var(--focus); border-radius: var(--radius-2); }
.tape__title { font-weight: 600; }
.tape__sub { font-size: var(--text-small); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape__body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: var(--space-3); }
.tape__heads { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.tape__head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.tape__head .nameplate { flex: 1; min-width: 0; }
.tape__table { min-width: 0; }
.tape__table th:first-child, .tape__table td:first-child { color: var(--ink-3); font-size: var(--text-micro); text-transform: uppercase; letter-spacing: var(--tracking-micro); font-weight: 600; }
.tape__table td { font-variant-numeric: tabular-nums; }
.tape__table td.num { width: 34%; }
.tape__table td.better { color: var(--gold); font-weight: 600; }
.tape__table td.better::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-left: var(--space-2); vertical-align: middle; }
.tape__note { font-size: var(--text-micro); color: var(--ink-3); letter-spacing: 0.02em; }
.tape .nameplate__meta .sep { display: none; }
@media (max-width: 1199px) { .tape__heads { grid-template-columns: 1fr; } }

/* =========================================================== roster grid */
.roster { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--line-1); }
.roster .section-head { margin-bottom: var(--space-3); }
.roster__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-4); min-height: 320px; }
.roster__grid > .empty { grid-column: 1 / -1; }
.roster__grid > .skeleton--card { height: auto; aspect-ratio: 3 / 4.6; }
@media (max-width: 1199px) { .roster__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 719px) { .roster__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); } }

.fcard { position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; margin: 0; text-align: left; font: inherit; color: inherit; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius-2); overflow: hidden; cursor: pointer; transition: border-color var(--dur-1) var(--ease), transform var(--dur-2) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease); }
.fcard:hover, .fcard:focus-visible { border-color: var(--line-2); background: var(--bg-2); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.fcard:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-2); }
.fcard:active { transform: none; }
.fcard[aria-pressed="true"] { border-color: var(--gold); }
.fcard[aria-pressed="true"]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px var(--gold); }
.fcard.is-taken .fcard__img { opacity: 0.6; }
.fcard.is-taken:hover .fcard__img, .fcard.is-taken:focus-visible .fcard__img { opacity: 1; }
.fcard .tier-stripe { height: 3px; border-radius: 0; }
.fcard__portrait { position: relative; aspect-ratio: 3 / 4; background: var(--bg-2); overflow: hidden; }
.fcard__img { position: absolute; inset: 0; border-radius: 0; transition: opacity var(--dur-2) var(--ease); }
.fcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity var(--dur-3) var(--ease); }
.fcard__img.is-ready img { opacity: 1; }
.fcard__img.skeleton::after { animation-duration: 1.4s; }
.fcard__img.is-static { display: flex; align-items: center; justify-content: center; background: var(--bg-2); }
.fcard__img.is-static img { display: none; }
.fcard__initials { font-family: var(--font-display); font-size: 44px; letter-spacing: 0.06em; color: var(--ink-4); }
.fcard__id { position: absolute; top: var(--space-2); left: var(--space-2); font-family: var(--font-display); font-size: 18px; letter-spacing: 0.04em; line-height: 1; color: var(--ink-2); background: rgba(8, 8, 10, 0.72); padding: 4px 6px 3px; border-radius: var(--radius-1); }
.fcard__mini { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); align-items: end; padding: var(--space-2) var(--space-3); background: rgba(8, 8, 10, 0.78); opacity: 0; transform: translateY(6px); transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.fcard:hover .fcard__mini, .fcard:focus-visible .fcard__mini { opacity: 1; transform: none; }
.fcard__mini i { display: flex; flex-direction: column; align-items: center; gap: 3px; font-style: normal; font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.fcard__mini i::before { content: ""; display: block; width: 100%; height: calc(var(--v, 0) * 28px); min-height: 2px; background: var(--gold); border-radius: 2px 2px 0 0; }
.fcard__body { display: flex; flex-direction: column; gap: 6px; padding: var(--space-3); flex: 1; }
.fcard__name { font-weight: 600; font-size: var(--text-body); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-1); }
.fcard__meta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.fcard__price { font-family: var(--font-mono); font-size: var(--text-small); font-weight: 600; color: var(--ink-1); }
.fcard__line { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); font-size: var(--text-small); color: var(--ink-3); }
.fcard__line .num { color: var(--ink-2); }
.fcard__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-top: auto; padding-top: 2px; }
.fcard__rec { font-family: var(--font-mono); font-size: var(--text-small); color: var(--ink-2); }
.fcard__rec .w { color: var(--ok); }
.fcard__rec .l { color: var(--ink-3); }
@media (max-width: 719px) {
  .fcard__body { padding: var(--space-2) var(--space-3) var(--space-3); }
  .fcard__mini { opacity: 1; transform: none; padding: 6px var(--space-2); }
  .fcard__mini i { font-size: 8px; }
  .fcard__mini i::before { height: calc(var(--v, 0) * 18px); }
}

.page-foot { margin-top: var(--space-4); font-size: var(--text-small); border-top: 1px solid var(--line-1); padding-top: var(--space-4); }
.page-foot a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.page-foot a:hover { color: var(--ink-1); }

/* =========================================================== viewer loading overlay (created by fighter3d.js inside .stage) */
.viewer-loading { position: absolute; left: 50%; top: var(--space-4); transform: translateX(-50%); display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill); background: rgba(8, 8, 10, 0.78); border: 1px solid var(--line-2); color: var(--ink-2); font-size: var(--text-small); font-weight: 500; pointer-events: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap; z-index: 2; }
.viewer-loading[hidden] { display: none; }
.viewer-loading.error { color: var(--bad); border-color: rgba(255, 77, 109, 0.5); }
.viewer-loading.error .viewer-loading-dot { display: none; }
.viewer-loading-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gold); border-right-color: transparent; animation: spin 0.8s linear infinite; }

/* =========================================================== motion */
@media (prefers-reduced-motion: reduce) {
  .fcard, .fcard__mini, .fcard__img, .fcard__img img { transition: none; }
  .fcard:hover, .fcard:focus-visible { transform: none; }
  .fcard:hover .fcard__mini, .fcard:focus-visible .fcard__mini { transform: none; }
  .viewer-loading-dot { animation: none; border-right-color: var(--gold); }
}
