/* Game screens. Builds on the tokens and components in app.css. */

.btn--lg { min-height: 44px; padding: 10px 18px; font-size: 13px; }
.loss-text { color: var(--loss-ink); }
.is-mine { background: color-mix(in oklab, var(--accent) 12%, transparent) !important; font-weight: 600; }
.live-flag { color: var(--accent-2-ink); font: 400 10px/1 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.08em; }
.flag { vertical-align: middle; }

/* ---------- Title screen ---------- */
.boot { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 16px 40px; text-align: center; padding-block: 8px 24px; }
.boot__bars { display: grid; gap: 3px; width: min(100%, 560px); }
.boot__bars i { display: block; height: 6px; background: var(--copper); background-size: 100% 6px; image-rendering: pixelated; opacity: 0; animation: boot-bar var(--duration-very-slow) var(--ease-smooth-out) both; }
.boot__bars i:nth-child(1) { animation-delay: 0ms; } .boot__bars i:nth-child(2) { animation-delay: 60ms; } .boot__bars i:nth-child(3) { animation-delay: 120ms; }
.boot__bars i:nth-child(4) { animation-delay: 180ms; } .boot__bars i:nth-child(5) { animation-delay: 240ms; } .boot__bars i:nth-child(6) { animation-delay: 300ms; }
.boot__bars i:nth-child(even) { background: var(--copper-blue); background-size: 100% 6px; }
@keyframes boot-bar { from { opacity: 0; transform: scaleX(0.2); } to { opacity: 1; transform: none; } }
.boot__copy { display: grid; gap: 16px; justify-items: center; width: 100%; min-width: 0; container-type: inline-size; }
.boot__kicker { color: var(--text-dim); font-size: 11px; margin: 0; }
.boot__logo {
  margin: 0; font-size: clamp(26px, 11cqi, 72px); line-height: 1; color: var(--text); white-space: nowrap; max-width: 100%;
  text-shadow: 3px 3px 0 var(--accent-2), 6px 6px 0 var(--accent);
  animation: rise var(--duration-very-slow) var(--ease-smooth-out) 200ms both;
}
.boot__tag { margin: 0; color: var(--text-dim); max-width: 44ch; }
.boot__stage { width: 100%; min-width: 0; display: grid; justify-items: center; gap: 12px; }
.boot__stage .ring-wrap { justify-self: center; }
.boot__faces { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.boot__form { width: min(100%, 420px); text-align: left; }
@media (min-width: 1100px) {
  .boot { grid-template-columns: minmax(400px, 520px) minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; justify-items: stretch; text-align: left; }
  .boot__bars { grid-column: 1; grid-row: 1; justify-self: stretch; width: 100%; }
  .boot__copy { grid-column: 2; grid-row: 1 / span 2; justify-items: start; }
  .boot__logo { font-size: clamp(36px, 10.5cqi, 64px); }
  .boot__stage { grid-column: 1; grid-row: 2; }
}

/* ---------- Gym ---------- */
.advance__body { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.advance { position: relative; }
.advance__loading { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px; padding-inline: 12px; border-radius: inherit; background: var(--surface); }
.advance__loading[hidden] { display: none; }
.advance__loading canvas { width: 96px; height: 96px; flex: none; image-rendering: pixelated; }
@media (min-width: 720px) { .advance__loading canvas { width: 64px; height: 64px; image-rendering: auto; } }
.advance__line { display: block; flex: none; width: min(28ch, calc(100% - 108px)); min-height: 2.6em; text-align: left; overflow-wrap: break-word; font: 400 12px/1.3 var(--font-pixel); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); animation: rise var(--duration-fast) var(--ease-smooth-out) both; }
@media (max-width: 479px) { .advance__line { min-height: 3.9em; } }
.gym-cols { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .gym-cols { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); } }
.stable-meta { margin: 0; font-size: 12px; }
.stable-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow), inset 1px 1px 0 var(--bevel-hi); overflow: hidden; gap: 10px; padding-bottom: 12px; align-content: start; }
.stable-item > .fcard { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; height: auto; }
.stable-item > .fcard:hover { transform: none; }
.stable-item > .mrows, .stable-item > .stable-meta { padding-inline: 12px; }
.brow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "when fight belts" "when meta belts"; gap: 4px 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.brow:last-child { border-bottom: 0; }
.brow:hover { background: var(--surface-2); }
.brow__when { grid-area: when; font-size: 11px; color: var(--text-dim); align-self: start; padding-top: 6px; }
.brow__fight { grid-area: fight; display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; }
.brow__f { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brow__f b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow__f--red .portrait-frame { border-color: var(--red-corner); }
.brow__f--blue .portrait-frame { border-color: var(--blue-corner); }
.brow__v { color: var(--text-dim); font-size: 11px; }
.brow__meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0 12px; min-width: 0; }
.brow__meta small { font-size: 12px; }
.brow__belts { grid-area: belts; display: flex; gap: 3px; align-items: center; }
.portrait--1x { width: 32px; height: 32px; }
@media (max-width: 479px) { .brow { grid-template-columns: 1fr auto; grid-template-areas: "when belts" "fight fight" "meta meta"; } .brow__when { padding-top: 0; } }

/* ---------- Mini fighter ---------- */
.mini { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; min-width: 0; }
.mini__txt { display: grid; gap: 2px; min-width: 0; }
.mini__txt small { font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mini__belts { gap: 3px; }

/* ---------- Fighter profile ---------- */
.fprofile { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.fprofile__name { margin: 0; font-size: clamp(16px, 4vw, 26px); width: fit-content; }
/* Every item carries a leading dot; the row is shifted left by one dot width and that strip is clipped, so a dot at the start of any line is hidden. */
.fmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-left: -16px; clip-path: inset(-8px -8px -8px 16px); }
.fmeta__i { position: relative; display: inline-flex; align-items: center; gap: 6px; padding-left: 16px; white-space: nowrap; }
.fmeta__i::before { content: "\00b7"; position: absolute; left: 0; width: 16px; text-align: center; color: var(--text-dim); }
.fprofile__nick { margin: 0; font-style: italic; }
.fprofile__rec { font-size: 20px; }
.fprofile__elo { grid-column: 1 / -1; }
@media (min-width: 720px) { .fprofile { grid-template-columns: auto 1fr auto; } .fprofile__elo { grid-column: auto; justify-items: end; } }

/* ---------- Offers ---------- */
.offer__wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.offer__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.offer__avail { border-top: 1px dashed var(--line); padding-top: 12px; }
.offer__talk--ok { color: var(--win-ink); }
.offer__warn { margin: 0; font-size: 12px; font-weight: 600; color: var(--loss-ink); }
@media (min-width: 900px) { .offer__body { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: center; } }
.offer__fighters { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.offer__vs { color: var(--text-dim); font-size: 12px; }
@media (max-width: 599px) { .offer__fighters { grid-template-columns: minmax(0, 1fr); } .offer__vs { display: none; } }
.offer .btn { max-width: 100%; white-space: normal; line-height: 1.3; }
.offer .mini__txt { overflow-wrap: anywhere; }
.offer--done { opacity: 0.85; }
.htmx-swapping.offer { opacity: 0; transform: translateY(var(--distance-micro)); transition: opacity 150ms var(--ease-smooth-out), transform 150ms var(--ease-smooth-out); }

/* ---------- Fight night ---------- */
.line-on .belt__label { text-transform: none; font-family: var(--font-body); font-size: 12px; letter-spacing: 0; }
.tape { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .tape { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) minmax(0, 1fr); } }
.tape__side { display: grid; gap: 10px; justify-items: start; }
.tape__mid { display: grid; gap: 8px; }
.tape__title { text-align: center; font-size: 12px; }
.tape__table { background: var(--surface); border: 1px solid var(--line); }
.tape__table th { text-align: center; font: 400 10px/1 var(--font-pixel); text-transform: uppercase; color: var(--text-dim); background: var(--surface-2); }
.tape__table td { text-align: center; }
.tape__table td.num { text-align: center; }
.tape-t { width: 100%; table-layout: fixed; background: var(--surface); border: 1px solid var(--line); border-collapse: separate; border-spacing: 0; }
.tape-t th, .tape-t td { text-align: center; }
.tape-t tbody th { font: 400 10px/1 var(--font-pixel); text-transform: uppercase; white-space: nowrap; padding-inline: 4px; color: var(--text-dim); background: var(--surface-2); }
.tape-t thead th { background: var(--surface-2); padding: 6px; vertical-align: bottom; }
.tape-t__vs { color: var(--text-dim); }
.tape-t__col { width: 10.5ch; font: 400 10px/1 var(--font-pixel); }
.tape-t__modhead th { padding-block: 6px 2px; }
.tape-t__mods td[aria-hidden] { background: var(--surface-2); }
.tape-t__h { position: sticky; top: 0; z-index: 2; border-top: 4px solid var(--corner); }
.tape-t__h--red { --corner: var(--red-corner); --corner-ink: var(--red-corner-ink); background: color-mix(in oklab, var(--red-corner) 14%, var(--surface)) !important; }
.tape-t__h--blue { --corner: var(--blue-corner); --corner-ink: var(--blue-corner-ink); background: color-mix(in oklab, var(--blue-corner) 14%, var(--surface)) !important; }
.tape-t__corner { display: block; font: 400 9px/1 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.06em; color: var(--corner-ink); margin-bottom: 4px; }
.tape-t__who { display: grid; gap: 4px; justify-items: center; }
.tape-t__who b { font-size: 12.5px; line-height: 1.15; overflow-wrap: anywhere; white-space: normal; }
.tape-t__who .portrait-frame { border-color: var(--corner); }
.tape-t td.tape-t__r { background: color-mix(in oklab, var(--red-corner) 8%, transparent); box-shadow: inset 3px 0 0 color-mix(in oklab, var(--red-corner) 55%, transparent); }
.tape-t td.tape-t__b { background: color-mix(in oklab, var(--blue-corner) 8%, transparent); box-shadow: inset -3px 0 0 color-mix(in oklab, var(--blue-corner) 55%, transparent); }
.tape-t td.tape-t__r.tape-t__win { color: var(--red-corner-ink); font-weight: 700; background: color-mix(in oklab, var(--red-corner) 20%, transparent); }
.tape-t td.tape-t__b.tape-t__win { color: var(--blue-corner-ink); font-weight: 700; background: color-mix(in oklab, var(--blue-corner) 20%, transparent); }
.tape-t td.tape-t__r { text-align: right; padding-right: 10px; }
.tape-t td.tape-t__b { text-align: left; padding-left: 10px; }
.tape-t td { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.tape-t .chip-mod { overflow-wrap: anywhere; }
.tape-t__mods .chips-mod { justify-content: center; }
.tape-t--compact { font-size: 12px; }
.tape-t--compact thead th { padding: 4px; }
.tape-t--compact td { padding: 3px 6px; }
@media (min-width: 900px) { .tape-t__h { position: static; } }
@media (max-width: 899px) { .tape-t__h { top: 0; } }
@media (min-width: 600px) and (max-width: 899px) { .tape-t__h { top: 92px; } }
.round-entry { display: grid; grid-template-columns: 28px 1fr; gap: 8px; }
.round-entry .follows { color: var(--win-ink); }
.round-entry .ignores { color: var(--accent-2-ink); }
.note { font-weight: 700; }
.note--kd { color: var(--loss-ink); }
.note--cut { color: #b04aa0; }
.note--foul, .note--edge-bad { color: var(--loss-ink); }
.note--edge { color: var(--win-ink); }
.note--read { color: var(--text-dim); }
.note--edge, .note--edge-bad, .note--clinch, .note--read { font-weight: 400; }
.result { overflow: hidden; }
.result__body { display: grid; gap: 16px; }
@media (min-width: 720px) { .result__body { grid-template-columns: 1.4fr 1fr; } }
.result__headline { font-size: clamp(18px, 4vw, 28px); }
.result--win .result__headline { color: var(--win-ink); }
.result--loss .result__headline { color: var(--loss-ink); }
.result__method { font-weight: 700; }
.result__facts { display: grid; gap: 8px; margin: 0; align-content: start; }
.result__facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.result__facts dt { color: var(--text-dim); }
.result__facts dd { margin: 0; font-weight: 700; }

/* ---------- Rankings ---------- */
.divtabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.divtabs::-webkit-scrollbar { display: none; }
.divtabs a { padding: 7px 10px; white-space: nowrap; color: var(--text-dim); text-decoration: none; font: 400 11px/1 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.06em; border-radius: var(--radius); transition: color var(--duration-quick) var(--ease-smooth-out), background-color var(--duration-quick) var(--ease-smooth-out); }
.divtabs a:hover { color: var(--text); }
.divtabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.champs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.champ { display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); align-content: start; }
.champs--undisputed .champ { border-color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 8%, var(--surface)); }

/* ---------- Betting ---------- */
.bet__body { display: grid; gap: 12px; }
@media (min-width: 900px) { .bet__body { grid-template-columns: 1fr 1fr; } .bet__form { grid-column: 1 / -1; } }
.bet__side { display: grid; gap: 8px; justify-items: start; }
.bet__side--red .mini__txt b { color: var(--red-corner-ink); }
.bet__side--blue .mini__txt b { color: var(--blue-corner-ink); }
.bet__pick { border: 0; padding: 0; margin: 0; gap: 12px; }
.bet__pick label { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Week summary ---------- */
dialog.modal--wide { width: min(94vw, 560px); max-height: 88dvh; overflow: auto; }
.wk-money { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 16px; }
.wk-group ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.wk-group h3 { margin: 0; }

/* ---------- Ring: stage, controls, mobile ---------- */
.ring-card { display: grid; gap: 14px; align-items: start; }
@media (min-width: 1094px) { .ring-card { grid-template-columns: auto minmax(260px, 1fr); } }
.ring-stage { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.ring-wrap canvas { max-width: none; }
#ring.is-skippable { cursor: pointer; }
.ring-tools {
  position: absolute; inset: auto 0 0 0; z-index: 5; display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 14px 6px 4px; line-height: 1;
  background: linear-gradient(to top, rgba(0, 0, 10, 0.82), rgba(0, 0, 10, 0));
  opacity: 0.75; transition: opacity var(--duration-quick) var(--ease-smooth-out);
}
.ring-tools:hover, .ring-tools:focus-within { opacity: 1; }
@media (hover: none) { .ring-tools { opacity: 1; } }
.ring-tools .seg { border-color: rgba(255, 255, 255, 0.35); background: rgba(0, 0, 10, 0.55); }
.ring-tools .seg button { min-height: 24px; min-width: 0; padding: 0 8px; font-size: 10px; color: #dfe6f3; }
.ring-tools .seg button[aria-checked="true"], .ring-tools .ring-sound[aria-pressed="true"] { background: #b8d6ff; color: #00122e; }
.ring-tools .seg button + button { border-inline-start-color: rgba(255, 255, 255, 0.2); }
.ring-tools .seg button:hover:not([aria-checked="true"]) { color: #fff; background: rgba(255, 255, 255, 0.18); }
.ring-tools button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; position: relative; z-index: 1; }
.ring-sound {
  appearance: none; display: inline-grid; place-items: center; width: 26px; height: 24px; padding: 0; cursor: pointer; color: #dfe6f3;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: var(--radius); background: rgba(0, 0, 10, 0.55);
}
.ring-tools .scene-pause { position: static; width: 26px; height: 24px; margin-inline-start: auto; color: #dfe6f3; background: rgba(0, 0, 10, 0.55); border-color: rgba(255, 255, 255, 0.35); }
.ring-sound:hover { color: #fff; background: rgba(255, 255, 255, 0.18); }
.ring-sound[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ring-sound[aria-pressed="true"] .ico-off, .ring-sound[aria-pressed="false"] .ico-on { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--text-dim); cursor: pointer; min-height: 32px; min-width: 44px; padding: 0 12px;
  font: 400 11px/1 var(--font-pixel); letter-spacing: 0.06em; text-transform: uppercase;
  transition: background-color var(--duration-quick) var(--ease-smooth-out), color var(--duration-quick) var(--ease-smooth-out);
}
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button:hover:not([aria-checked="true"]) { color: var(--text); background: var(--surface-3); }
.corner-read { margin: 0; }
.corner-read:empty { display: none; }
@media (max-width: 639px) {
  .ring-stage { justify-items: center; }
  .ring-wrap { justify-self: stretch; width: auto; margin-inline: -12px; border-inline-width: 0; }
  .ring-ticker { justify-self: stretch; padding-inline: 12px; }
}

/* ---------- Fight night: header, ring, controls under the ring, then the tape and stats ---------- */
.fight-head { display: grid; gap: 6px; }
.fight-head__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: start; }
.fh-side { display: grid; gap: 2px; min-width: 0; padding-top: 4px; border-top: 3px solid var(--corner); }
.fh-side--red { --corner: var(--red-corner); }
.fh-side--blue { --corner: var(--blue-corner); justify-items: end; text-align: right; }
.fh-name { font: 400 15px/1.15 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.kit-stripe { display: inline-block; flex: none; width: 9px; height: 1.05em; margin-inline: 6px; vertical-align: -0.15em; border: 1px solid var(--text-dim); background: linear-gradient(90deg, var(--trunks) 50%, var(--trim) 50%); }
.kit-stripe:first-child { margin-inline-start: 0; }
.fh-info { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 12px; color: var(--text-dim); }
.fh-side--blue .fh-info { justify-content: flex-end; }
.fh-vs { color: var(--text-dim); font-size: 14px; align-self: center; }
.fight-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 12px; }
@media (min-width: 640px) { .fh-name { font-size: 20px; } .fh-info { font-size: 13px; } }
.ring-controls { min-width: 0; }
.ring-controls[hidden] { display: none; }
.ring-ticker { margin: 0; height: 2.8em; font-size: 12.5px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; min-width: 0; color: var(--text-dim); }
.advice[aria-disabled="true"] { opacity: 0.5; filter: grayscale(0.6); cursor: not-allowed; }
.advice[aria-disabled="true"] .advice__opt { cursor: not-allowed; }
#round-form > .row { flex-wrap: nowrap; }
#round-form #ring-go { flex: 2 1 0; min-width: 0; }
#round-form #sim-rest { flex: 1 1 0; min-width: 0; padding-inline: 8px; }
.corner-pair { display: grid; gap: 10px; align-items: start; }
@media (min-width: 1094px) {
  .ring-stage { grid-column: 1; grid-row: 1; }
  .ring-controls { grid-column: 1; grid-row: 2; width: 0; min-width: 100%; }
  .ring-side { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 639px) {
  .corner-pair { grid-template-columns: 1fr 1fr; gap: 8px; }
  .corner-pair .corner-panel { grid-template-columns: 1fr; }
  .corner-pair .portrait-frame { display: none; }
  .ring-panel .panel__body { padding-block: 8px; }
  .fight-head { gap: 4px; }
  .fight-head__meta { font-size: 11px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
  .fh-week { display: none; }
  #round-form, .ring-controls { gap: 6px; }
  #round-form .advice legend { margin-bottom: 4px; }
  #round-form .advice__opts { gap: 4px; }
  #round-form .advice__opt span { padding: 6px 2px; min-height: 36px; align-content: center; text-align: center; }
  #round-form .advice__opt b { font-size: 11px; letter-spacing: 0.02em; }
  #round-form .advice__opt small { display: none; }
  .cb th, .cb td { padding: 4px 5px; font-size: 11px; }
}
@media (max-width: 479px) {
  #round-form .advice__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #round-form .advice__opt small { display: block; }
}
.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow), inset 1px 1px 0 var(--bevel-hi); min-width: 0; }
.fold > summary { display: block; cursor: pointer; padding: 12px; min-height: 44px; list-style: none; font: 400 12px/1.4 var(--font-pixel); letter-spacing: 0.08em; text-transform: uppercase; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "\25B8"; display: inline-block; width: 1.2em; }
.fold[open] > summary::before { content: "\25BE"; }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.fold__body { padding: 12px; }
.fold__body--flush { padding: 0; }
.fight-more { margin-top: 4px; }

/* ---------- Gym: top row and next fight ---------- */
.gym-top { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .gym-top { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); align-items: stretch; }
  .gym-top .grid--tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
}
.gym-top:not(:has(.nextfight)) { grid-template-columns: minmax(0, 1fr); }
.gym-top:not(:has(.nextfight)) .grid--tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.nextfight-wrap { display: grid; gap: 12px; min-width: 0; }
.nextfight-wrap > .nextfight { align-self: stretch; }
.nextfight-poster .poster-btn { margin-inline: auto; }
.nextfight-poster .poster-btn--wide { max-width: 512px; }
.poster-orient--tall { display: none; }
@media (width >= 720px) {
  .poster-orient--tall { display: block; }
  .poster-orient--wide { display: none; }
  .nextfight-wrap--poster { --poster-w: 240px; grid-template-columns: minmax(0, var(--poster-w)) minmax(0, 1fr); align-items: start; }
  .nextfight-poster .poster-btn { max-width: var(--poster-w); margin-inline: 0; }
}
@media (min-width: 900px) { .nextfight-wrap--poster { --poster-w: clamp(200px, 22vw, 280px); } }
@media (min-width: 900px) { .gym-top:has(.nextfight-wrap--poster) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.nextfight {
  display: grid; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 1px 1px 0 var(--bevel-hi); color: var(--text); text-decoration: none; align-content: space-between;
  transition: border-color var(--duration-quick) var(--ease-smooth-out), transform var(--duration-quick) var(--ease-smooth-out);
}
.nextfight:hover { border-color: var(--accent); color: var(--text); }
.nextfight--now { border-color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 7%, var(--surface)); }
.nextfight__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nextfight__when { font-size: 12px; color: var(--accent-2-ink); }
.nextfight__vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.nextfight__f { display: grid; gap: 4px; justify-items: center; text-align: center; min-width: 0; }
.nextfight__f b { font-size: 13px; overflow-wrap: anywhere; }
.nextfight__f--red .portrait-frame { border-color: var(--red-corner); }
.nextfight__f--blue .portrait-frame { border-color: var(--blue-corner); }
.nextfight__v { color: var(--text-dim); font-size: 14px; }
.nextfight__foot { display: flex; gap: 6px 16px; justify-content: center; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.nextfight__foot b { color: var(--text); }

/* ---------- Scorecard ---------- */
.sc { table-layout: auto; width: 100%; min-width: 0; }
.sc thead th, .sc tbody td, .sc tbody th { background: var(--surface); }
.sc thead th { background: var(--surface-2); }
.sc tbody tr:nth-child(even) { background: none; }
.sc th:first-child, .sc td:first-child { min-width: 10em; text-align: left; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.sc .judge-row th { text-align: left; background: var(--surface-3); }
.sc th.num, .sc td.num { text-align: center; font-variant-numeric: tabular-nums; }
.sc th.num, .sc td.num { width: 1%; min-width: 2.6em; padding-inline: 4px; }
.sc th.tot, .sc td.tot { min-width: 3.6em; }
.sc td.low { color: var(--text-dim); }

/* ---------- Betting ---------- */
.bet__body { display: grid; gap: 14px; }
@media (min-width: 900px) { .bet__body { grid-template-columns: 1fr 1fr; } .bet__pick { gap: 14px; } }
.pick, .pick span { width: 100%; height: 100%; }
.bet__side { display: grid; justify-items: stretch; grid-row: span 3; grid-template-rows: subgrid; gap: 10px; align-content: start; }
.corner-label { font: 400 10px/1.2 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 8px; color: #fff; justify-self: stretch; overflow-wrap: anywhere; }
.corner-label--red { background: var(--red-corner-solid); } .corner-label--blue { background: var(--blue-corner-solid); }
.pick__corner { font: 400 9px/1 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.06em; }
.pick--red .pick__corner { color: var(--red-corner-ink); } .pick--blue .pick__corner { color: var(--blue-corner-ink); }
.pick input:checked + span .pick__corner { color: inherit; }
.bet__side .odds { width: 100%; justify-content: space-between; }
.bet__form { grid-column: 1 / -1; display: grid; gap: 14px; }
.bet__pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.bet__pick legend { padding: 0; margin-bottom: 6px; }
.pick { position: relative; display: block; min-width: 0; cursor: pointer; }
.pick input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.pick span {
  display: grid; gap: 4px; align-content: center; min-height: 84px; padding: 10px 14px; text-align: center;
  border: 2px solid var(--field-border); border-radius: var(--radius); background: var(--surface-2); box-sizing: border-box;
  transition: background-color var(--duration-quick) var(--ease-smooth-out), border-color var(--duration-quick) var(--ease-smooth-out), color var(--duration-quick) var(--ease-smooth-out), box-shadow var(--duration-quick) var(--ease-smooth-out);
}
.pick b { font-size: 14px; overflow-wrap: anywhere; }
.pick small { color: var(--text-dim); font-size: 12px; }
.pick__flag { font: 400 10px/1 var(--font-pixel); font-style: normal; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0; transition: opacity var(--duration-quick) var(--ease-smooth-out); }
.pick--red span { border-color: color-mix(in oklab, var(--red-corner) 55%, var(--line)); }
.pick--blue span { border-color: color-mix(in oklab, var(--blue-corner) 55%, var(--line)); }
.pick:hover span { border-color: var(--text); }
.pick--red input:checked + span { background: var(--red-corner-solid); border-color: var(--red-corner-solid); color: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--red-corner-solid); }
.pick--blue input:checked + span { background: var(--blue-corner-solid); border-color: var(--blue-corner-solid); color: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--blue-corner-solid); }
.pick input:checked + span small { color: inherit; opacity: 0.9; }
.pick input:checked + span .pick__flag { opacity: 1; }
.pick input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 4px; }
.bet__stake { display: flex; gap: 10px 16px; align-items: end; flex-wrap: wrap; }
.stake-field { display: inline-flex; align-items: center; gap: 6px; }
.stake-field input { width: 8em; min-height: 40px; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chipbtn {
  appearance: none; min-height: 40px; min-width: 56px; padding: 0 14px; cursor: pointer; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font: 400 12px/1 var(--font-pixel); letter-spacing: 0.04em;
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
}
.chipbtn:hover { border-color: var(--accent); }
.chipbtn:active { transform: translateY(1px); }
@media (max-width: 599px) { .bet__form .btn { width: 100%; } }

/* ---------- Week summary ---------- */
.wk-fights { display: grid; gap: 6px; }
.wk-fight { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.wk-around summary { cursor: pointer; font: 400 11px/1 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 0; }
.wk-around ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }

/* ---------- Rankings: bodies in a container-width grid ---------- */
.bodies { container-type: inline-size; }
.bodies__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container (min-width: 640px) { .bodies__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 1500px) { .bodies__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bodies__col { overflow: hidden; }
.data--tight { table-layout: fixed; width: 100%; }
.data--tight td { padding: 5px 6px; }
.data--tight :is(th, td):nth-child(1) { width: 2.2rem; }
.data--tight :is(th, td):nth-child(3) { width: 4.6rem; }
.data--tight :is(th, td):nth-child(4) { width: 3.6rem; }
.data--tight td:nth-child(2) { overflow: hidden; }
.data--tight .opp { min-width: 0; }
.data--tight .opp a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.data--wrap td:nth-child(2) { white-space: normal; overflow: visible; }
.data--wrap .opp { white-space: normal; align-items: flex-start; flex-wrap: nowrap; gap: 6px; }
.data--wrap .opp a { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; min-width: 0; }
.data--wrap .opp .flag, .data--wrap .opp .titles { flex-shrink: 0; }
.data--hall { table-layout: fixed; width: 100%; }
.data--hall td { padding: 5px 6px; }
.data--hall :is(th, td):nth-child(2) { width: 4.6rem; }
.data--hall :is(th, td):nth-child(3) { width: 6rem; }
.data--hall :is(th, td):nth-child(4) { width: 3.4rem; }
.data--hall .opp { align-items: flex-start; gap: 6px; }
.data--hall .opp a { overflow-wrap: break-word; min-width: 0; }
.data--hall .opp .flag { flex-shrink: 0; }
.champ .mini { min-height: 0; }

/* ---------- Scroll rails ---------- */
[data-rail] { position: relative; scroll-snap-type: x proximity; scroll-padding-inline: 28px; }
[data-rail] > a { scroll-snap-align: center; }
[data-rail].has-end { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
[data-rail].has-start { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); }
[data-rail].has-start.has-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }

/* ---------- Money, header chips ---------- */
.chip--link { text-decoration: none; color: inherit; }
.chip--link:hover { border-color: var(--accent); }
.chip__value--alert { color: #1a0c00; background: var(--accent-2); padding: 1px 6px; border-radius: 2px; animation: alert-pulse 2.4s var(--ease-smooth-out) infinite; }
@keyframes alert-pulse { 0%, 70%, 100% { box-shadow: 0 0 0 0 transparent; } 80% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent-2) 45%, transparent); } }
@media (max-width: 719px) { .chip--rep .chip__label { display: none; } .chip--rep { padding-inline: 5px; } .chip--rep .chip__value::before { content: "R "; font: 400 9px/1 var(--font-pixel); color: var(--text-dim); } }
.city-note { margin: 0; min-height: 2.9em; }

/* ---------- Venue and promoter lines, tier stars ---------- */
.venue-line { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; font-size: 13px; }
.venue-line__k { color: var(--text-dim); font-size: 10px; margin-right: 4px; }
.venue-line__p { color: var(--text); text-decoration: none; }
.venue-line__p:hover b { text-decoration: underline; }
.tier { display: inline-flex; gap: 2px; vertical-align: middle; }
.tier__s { width: 12px; height: 12px; background: var(--surface-3); clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); }
.tier__s.is-on { background: var(--accent-2); }

/* ---------- Gym panel ---------- */
.rep__head { display: flex; justify-content: space-between; align-items: baseline; }
.rep__bar { height: 10px; background: var(--surface-3); position: relative; overflow: hidden; border: 1px solid var(--line); -webkit-mask-image: repeating-linear-gradient(90deg, #000 0, #000 calc(5% - 2px), transparent calc(5% - 2px), transparent 5%); mask-image: repeating-linear-gradient(90deg, #000 0, #000 calc(5% - 2px), transparent calc(5% - 2px), transparent 5%); }
.rep__bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 1%); background: linear-gradient(90deg, var(--accent-2), #ffc060); transform-origin: left; animation: bar-fill-x var(--duration-very-slow) var(--ease-smooth-out) both; }
.rep__track { position: relative; }
.rep__ceiling { position: absolute; top: -3px; bottom: -3px; left: calc(var(--c) * 1%); width: 2px; margin-left: -1px; background: var(--text); opacity: 0.8; }
.rep__bar--rel i { background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--accent) 60%, var(--accent-2))); }
@keyframes bar-fill-x { from { transform: scaleX(0); } }
.rep__note { margin: 4px 0 0; font-size: 12px; }
.costs { margin: 6px 0 0; display: grid; gap: 4px; }
.costs div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line); padding-bottom: 3px; font-size: 13px; }
.costs dt { color: var(--text-dim); }
.costs dd { margin: 0; font-weight: 600; }
.costs__total { border-bottom: 0 !important; border-top: 2px solid var(--line-strong); padding-top: 4px; }
.costs__total dt { color: var(--text); font-weight: 700; }
.advance--blocked { border-color: var(--accent-2); }
.wk-events { margin: 0; padding: 8px 10px; background: color-mix(in oklab, var(--accent-2) 12%, transparent); border: 1px solid var(--accent-2); }

/* ---------- Event dialog cards (Amiga style) ---------- */
.ev-stack { display: grid; gap: 14px; }
.ev {
  --ev-edge: var(--text); position: relative; background: var(--surface); border: 2px solid var(--ev-edge); border-radius: 0;
  box-shadow: 5px 5px 0 rgba(0, 0, 20, 0.32), inset 1px 1px 0 var(--bevel-hi); display: grid; gap: 0; overflow: hidden; scroll-margin-top: 80px;
}
.ev__bar { display: flex; align-items: center; gap: 10px; padding: 0 8px; min-height: 28px; background: var(--accent); color: var(--accent-ink); border-bottom: 2px solid var(--ev-edge); }
.ev__title { margin: 0; flex: 1; font: 400 12px/1.1 var(--font-pixel); letter-spacing: 0.06em; text-transform: uppercase; padding-block: 6px; }
.ev__gadget, .ev__depth { width: 14px; height: 14px; flex: none; background: var(--accent-ink); border: 2px solid var(--accent-2); box-shadow: inset 2px 2px 0 var(--accent); }
.ev__depth { background: linear-gradient(135deg, var(--accent-ink) 50%, var(--accent-2) 50%); box-shadow: none; border-color: var(--accent-ink); }
.ev__meta { display: flex; gap: 8px; align-items: center; padding: 8px 12px 0; }
.tag--done { background: var(--win-soft); color: var(--win-ink); }
.ev__main { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 12px; align-items: start; }
.ev__glyph { display: grid; place-items: center; width: 96px; height: 96px; background: var(--surface-3); border: 2px solid var(--line-strong); color: var(--text-dim); font-size: 14px; }
.ev__visual { display: grid; gap: 4px; width: 96px; justify-items: center; align-content: start; }
.ev__art { display: flex; align-items: center; justify-content: center; gap: 4px; width: 96px; height: 96px; background: color-mix(in oklab, var(--tint, transparent) 22%, var(--surface-3)); border: 2px solid var(--line-strong); box-sizing: border-box; }
.ev__art svg { flex: none; }
.ev__visual--promoter { width: auto; max-width: 160px; }
.ev__faces { display: flex; gap: 8px; }
.ev__pface { position: relative; display: inline-block; }
.ev__badge { position: absolute; right: -8px; bottom: -8px; display: grid; line-height: 0; filter: drop-shadow(0 1px 0 var(--surface)); }
.ev__art .fart { width: 88px; height: auto; }
.ev__cap { font-size: 9px; line-height: 1.25; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); text-align: center; overflow-wrap: anywhere; }
@media (max-width: 479px) { .ev__visual { justify-self: start; } }
.ev__text { display: grid; gap: 6px; min-width: 0; }
.ev__who { color: var(--text); text-decoration: none; }
.ev__body { margin: 0; font-size: 15px; line-height: 1.45; max-width: 62ch; }
.ev__body--scene { padding: 12px 12px 0; }
@media (max-width: 479px) { .ev__main { grid-template-columns: 1fr; } }
.ev__face { width: fit-content; justify-self: start; }
#inbox-count { display: inline-block; line-height: 1.4; min-height: 1.4em; }
.ev-auto__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ev-auto__list .dim { white-space: nowrap; }
.ev__auto { margin: 0; padding: 12px 12px 0; font-size: 13px; }
.ev__options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px; padding: 12px; }
.ev__options.htmx-request { opacity: 0.6; pointer-events: none; }
.ev__opt { display: grid; gap: 3px; justify-items: start; justify-content: stretch; align-items: start; width: 100%; padding-inline: 12px; text-align: left; white-space: normal; text-transform: none; letter-spacing: 0; font-family: var(--font-body); min-height: 56px; padding-block: 8px; height: 100%; align-content: start; }
.ev__opt b { font-size: 13px; font-weight: 700; line-height: 1.2; }
.ev__opt small { font-size: 11.5px; font-weight: 400; color: var(--text-dim); line-height: 1.3; }
.ev__opt[disabled] { opacity: 0.55; }
.ev__opt[disabled] small { color: var(--accent-2-ink); }
.ev__opt:hover small { color: inherit; }
.ev__opt--auto { border-style: dashed; }
.ev__options--scene { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px 12px 12px; }
.ev__options--scene .ev__opt { min-height: 40px; align-content: center; justify-items: center; text-align: center; padding-block: 6px; }
.ev__options--scene .ev__opt b { font-size: 13px; }
.ev__outcome { display: grid; gap: 8px; padding: 12px; margin: 12px; background: var(--surface-2); border: 2px dashed var(--line-strong); }
.ev__outcome > * { animation: ev-rise var(--duration-very-slow) var(--ease-smooth-out) both; }
.ev__outcome > :nth-child(2) { animation-delay: 80ms; } .ev__outcome > :nth-child(3) { animation-delay: 160ms; } .ev__outcome > :nth-child(4) { animation-delay: 240ms; }
@keyframes ev-rise { from { opacity: 0; transform: translateY(var(--distance-medium, 12px)); filter: blur(var(--blur-small)); } }
.ev__result { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.ev__mods { display: flex; gap: 12px 24px; flex-wrap: wrap; }
.ev__mods > div { display: grid; gap: 4px; }
.ev__mods-head { flex: 0 0 100%; margin: 0; font-size: 12px; color: var(--text-dim); }
.ev--resolved { --ev-edge: var(--line-strong); }
.ev--resolved .ev__bar { background: var(--text-dim); }
.ev.is-leaving { opacity: 0; transform: translateY(var(--distance-base)); transition: opacity var(--duration-medium) var(--ease-smooth-out), transform var(--duration-medium) var(--ease-smooth-out); }
.ev-stack--recent .ev { opacity: 0.9; }
.ev-stack--recent .ev__outcome { margin-top: 0; }
.ev.htmx-added { animation: none; }
.inbox-foot { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5; }
.chips-mod { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.chip-mod { font-size: 11.5px; font-weight: 600; padding: 3px 7px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.chip-mod--bad { border-color: var(--loss); color: var(--loss-ink); background: var(--loss-soft); }
.chip-mod--good { border-color: var(--win); color: var(--win-ink); background: var(--win-soft); }
.chip-mod--hot { border-color: var(--accent-2); color: var(--accent-2-ink); background: color-mix(in oklab, var(--accent-2) 14%, transparent); }
.corner-panel__mods, .corner-panel__states, .corner-panel__mind { grid-column: 1 / -1; }
.corner-panel__states[hidden] { display: none; }
.corner-panel__states .chip-mod { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.corner-panel__states small { font-weight: 400; font-size: 10.5px; }
.tape__side .chips-mod { margin-top: 2px; }

/* ---------- Press conference and face-off scenes ---------- */
.scene { position: relative; isolation: isolate; overflow: hidden; margin: 12px 12px 0; border: 2px solid var(--line-strong); color: #fff; --cap-h: 74px; background: #0b1b3d; }
.scene__stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: end; padding: 38px 8px 0; }
.scene__who { margin: 0; display: grid; justify-items: center; align-content: end; min-width: 0; }
.scene__who figcaption { position: relative; z-index: 3; display: grid; gap: 3px; justify-items: center; align-content: start; text-align: center; min-height: var(--cap-h); padding: 8px 6px 8px; width: 100%; background: rgba(0, 0, 26, 0.72); font-size: 13px; }
.scene__who figcaption small { color: #b8c4e0; font-size: 11.5px; }
.scene__who figcaption .dim { color: #b8c4e0; }
.scene__face { position: relative; z-index: 1; line-height: 0; transition: transform var(--duration-slow) var(--ease-smooth-out), filter var(--duration-slow) var(--ease-smooth-out); }
.scene__face canvas { width: 64px; height: 64px; border: 2px solid #000022; background: #1c2f5a; }
.scene__face--flip canvas { transform: scaleX(-1); }
.temper { display: inline-block; padding: 1px 6px; border: 1px solid currentColor; font: 400 10px/1.5 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.04em; }
.temper--fiery { color: #ff9c6b; } .temper--calm { color: #8fd3ff; } .temper--stubborn { color: #c9b8ff; } .temper--showman { color: #ffd966; }
.fx { font: 400 10px/1.5 var(--font-pixel); text-transform: uppercase; padding: 1px 6px; border: 1px solid transparent; background: #fff; color: #000022; animation: ev-rise var(--duration-slow) var(--ease-smooth-out) both; }
.fx--bad { background: #ff5a64; } .fx--good { background: #5fe08e; } .fx--hot { background: var(--accent-2); } .fx--dim { background: #b8c4e0; }

/* Fighter quick-look: portrait and name open a popover card */
.fq-btn { appearance: none; border: 0; padding: 0; margin: 0; background: none; color: inherit; font: inherit; cursor: pointer; display: block; }
.fq-btn:focus-visible, .fq-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fq-btn__i { position: absolute; top: 3px; right: 3px; z-index: 2; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--amiga-orange); color: #000022; border: 1px solid #000022; font: 700 12px/1 var(--font-pixel); font-style: normal; pointer-events: none; }
.fq-name { appearance: none; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 3px 4px; min-height: 24px; text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: #b8c4e0; }
.fq-name b { overflow-wrap: break-word; }
.fq {
  position: absolute; inset: auto; margin: 0; top: 0; left: 0; width: min(300px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
  padding: 10px 12px 12px; color: var(--text); background: var(--surface); text-align: left;
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow), inset 1px 1px 0 var(--bevel-hi);
}
.fq__head { display: flex; align-items: center; gap: 8px; }
.fq__head b { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.fq__x { flex: none; width: 28px; height: 28px; font-size: 18px; }
.fq__sub { margin: 2px 0 8px; font-size: 12px; }
.fq__list { margin: 0; display: grid; gap: 8px; }
.fq__row { display: grid; gap: 2px; }
.fq__row dt { color: var(--text-dim); font: 400 10px/1.2 var(--font-pixel); letter-spacing: 0.08em; text-transform: uppercase; }
.fq__row dd { margin: 0; display: grid; gap: 2px; min-width: 0; }
.fq__row small { color: var(--text-dim); font-size: 12px; line-height: 1.3; }
.fq__temper { font-weight: 700; font-size: 13px; }
.fq .mrows { margin-top: 8px; }
.mind-chip { cursor: pointer; min-height: 44px; font: inherit; }
.mind-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mind-pop p { margin: 0 0 6px; }
.mind-pop .bar-label { margin: 10px 0 4px; }
.ev__meta .help-btn { position: relative; }
.ev__meta .help-btn::after { content: ""; position: absolute; inset: -12px; }
.mind-pop .fq__row { display: flex; justify-content: space-between; gap: 8px; }
.mind-pop .fq__row dt { font: inherit; letter-spacing: 0; text-transform: none; color: var(--text); }
.mind-pop .fq__row dd { text-align: right; }
.mind-pop .fq__list + p { margin-top: 8px; }
.mind-pop .fq__row--stack { display: grid; gap: 2px; }
.mind-pop .fq__row--stack dt { font-weight: 700; overflow-wrap: anywhere; }
.mind-pop .fq__row--stack dd { text-align: left; overflow-wrap: anywhere; }

.scene--room { background: #0b1b3d; }
.scene__room { display: grid; justify-items: center; background: #014; }
.scene__canvas { display: block; width: 100%; max-width: 100%; aspect-ratio: 160 / 88; image-rendering: pixelated; }
.scene__canvas--faceoff { aspect-ratio: 160 / 90; }
.scene__seating { display: flex; gap: 6px; justify-content: center; width: 100%; padding: 4px 6px; background: rgba(0, 0, 26, 0.72); }
.scene__seat { appearance: none; flex: 1 1 0; max-width: 160px; min-height: 28px; padding: 2px 6px; color: #b8c4e0; background: transparent; border: 1px solid #b8c4e0; font: 400 10px/1.4 var(--font-pixel); letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.scene__seat[aria-pressed="true"] { color: #000022; background: #ffc060; border-color: #ffc060; }
.scene__seat:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.scene--room .scene__stage { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 6px; padding: 8px; }
.scene--room .scene__who { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "face name" "tags tags"; align-items: start; justify-items: start; gap: 4px 6px; text-align: left; }
.scene--room .scene__who figcaption { display: contents; }
.scene--room .scene__face { grid-area: face; }
.scene--room .fq-name { grid-area: name; align-self: center; text-align: left; }
.scene--room .scene__stage { container-type: inline-size; }
.scene--room .fq-name b { font-size: 12px; }
@container (max-width: 300px) {
  .scene--room .scene__who { grid-template-columns: minmax(0, 1fr); grid-template-areas: "face" "name" "tags"; }
  .scene--room .fq-name { align-self: start; padding-inline: 0; }
}
.scene__tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 3px; }

.ev--press, .ev--faceoff { --col: 560px; }
.ev--press .scene, .ev--faceoff .scene, .ev--press .ev__outcome, .ev--faceoff .ev__outcome { margin-inline: max(12px, calc((100% - var(--col)) / 2)); }
.ev--press .ev__body--scene, .ev--faceoff .ev__body--scene, .ev--press .ev__options--scene, .ev--faceoff .ev__options--scene { margin-inline: max(0px, calc((100% - var(--col) - 24px) / 2)); }
@media (max-width: 340px) {
  .ev--press .ev__meta > .tag:not(.tag--done), .ev--press .ev__meta > .dim, .ev--faceoff .ev__meta > .tag:not(.tag--done), .ev--faceoff .ev__meta > .dim { display: none; }
  .ev__options--scene .ev__opt { min-height: 38px; }
  .ev--press .ev__meta:not(:has(.help-btn, .tag--done)), .ev--faceoff .ev__meta:not(:has(.help-btn, .tag--done)) { display: none; }
  .ev--press .ev__body--scene, .ev--faceoff .ev__body--scene { font-size: 14px; }
  .scene--room .scene__face canvas { width: 56px; height: 56px; }
}

/* Outcome poses: a crisp pixel outline in the tone's colour, no glow */
@keyframes rattle { 0%, 100% { translate: 0 0; } 50% { translate: 4px -2px; } }
.scene--room[data-fx-mine~="rattled"] .scene__who--mine .scene__face, .scene--room[data-fx-theirs~="rattled"] .scene__who--theirs .scene__face { transform: rotate(-4deg); filter: saturate(0.5) brightness(0.85); animation: rattle 0.5s steps(2) 2; }
.scene--room[data-fx-mine~="fired"] .scene__who--mine .scene__face canvas, .scene--room[data-fx-mine~="wound"] .scene__who--mine .scene__face canvas,
.scene--room[data-fx-theirs~="fired"] .scene__who--theirs .scene__face canvas, .scene--room[data-fx-theirs~="wound"] .scene__who--theirs .scene__face canvas { border-color: #ff8800; box-shadow: 0 0 0 2px #000022; }
.scene--room[data-fx-mine~="cool"] .scene__who--mine .scene__face canvas, .scene--room[data-fx-theirs~="cool"] .scene__who--theirs .scene__face canvas { border-color: #5fe08e; box-shadow: 0 0 0 2px #000022; }

/* ---------- Facilities ---------- */
.grid--facilities { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.facility { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow), inset 1px 1px 0 var(--bevel-hi); align-content: start; }
.facility__art { display: grid; place-items: center; width: 108px; height: 108px; background: var(--surface-3); border: 2px solid var(--line-strong); image-rendering: pixelated; }
.fart { image-rendering: pixelated; width: 96px; height: 72px; }
.facility__name { margin: 0; font-size: 15px; }
.facility__blurb, .facility__effect { margin: 0; font-size: 13px; }
.facility .btn { justify-self: start; }
@media (max-width: 479px) { .facility { grid-template-columns: 1fr; } .facility__art { width: 100%; } }
.pips { display: flex; gap: 4px; }
.pip:nth-child(6) { margin-left: 4px; }
.pip { width: 16px; height: 14px; background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo); }
.pip.is-on { background: var(--accent-2); border-color: #a45a00; }
.pip.is-new { animation: pip-pop var(--duration-slow) var(--ease-bounce) both; }
@keyframes pip-pop { from { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.25); } }
.facility.is-upgraded { border-color: var(--accent-2); }
.equip-list { grid-column: 1 / -1; display: grid; gap: 8px; margin: 0; padding: 10px 0 0; list-style: none; border-top: 1px solid var(--line); }
.equip { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px 12px; font-size: 13px; }
.equip + .equip { border-top: 1px dashed var(--line); padding-top: 8px; }
.equip__info { display: grid; gap: 2px; min-width: 0; }
.equip__effect { color: var(--accent-2-ink); }
.equip__buy { display: grid; justify-items: end; gap: 4px; text-align: right; }
.equip__buy .btn { min-height: 32px; }
.equip.is-bought { outline: 1px solid var(--accent-2); outline-offset: 4px; }

/* ---------- Staff ---------- */
.role { display: grid; gap: 8px; }
.role__blurb { margin: 0; }
.role__grid { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .role__grid { grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); } }
.role__mine, .role__market { display: grid; gap: 6px; align-content: start; }
.role__cands { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.staffcard { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "face main" "face act"; gap: 6px 12px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); align-items: start; }
.staffcard .portrait-frame { grid-area: face; }
.staffcard__main { grid-area: main; display: grid; gap: 4px; min-width: 0; }
.staffcard__act { grid-area: act; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#staff-body:focus { outline: none; }
.staffcard--hired { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--surface)); }
.staffcard--empty, .staffcard--locked { display: block; border-style: dashed; padding: 14px; }
.staffcard__fx { margin: 2px 0 0; padding-left: 16px; display: grid; gap: 2px; font-size: 12px; color: var(--text-dim); }
.staffcard__vs { font-size: 12px; font-weight: 600; color: var(--accent); }
.staffcard__warn { margin: 0; font-size: 12px; font-weight: 600; color: var(--loss-ink); }
.staffcard__name { font-size: 14px; overflow-wrap: anywhere; }
.skillbar { position: relative; height: 12px; background: var(--surface-3); border: 1px solid var(--line); display: flex; align-items: center; }
.skillbar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 1%); background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--accent) 60%, var(--accent-2))); animation: bar-fill-x var(--duration-very-slow) var(--ease-smooth-out) both; transform-origin: left; }
.skillbar .num { position: relative; margin-left: auto; padding-right: 4px; font: 400 9px/1 var(--font-pixel); color: var(--text); mix-blend-mode: normal; text-shadow: 0 0 2px var(--surface); }

/* ---------- Talent ---------- */
.talent-head { justify-content: space-between; gap: 8px 20px; }
.prospect { display: grid; gap: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow), inset 1px 1px 0 var(--bevel-hi); }
@media (min-width: 900px) { .prospect { grid-template-columns: minmax(300px, 1.1fr) minmax(260px, 1fr) 190px; align-items: start; } }
.prospect__who { display: flex; gap: 12px; align-items: start; min-width: 0; }
.prospect__id { gap: 6px; min-width: 0; }
.prospect__name { font-size: 16px; }
.prospect__stars { display: grid; gap: 4px; }
.prospect__act { display: grid; gap: 8px; justify-items: stretch; align-content: start; }
.prospect__act .btn { width: 100%; justify-content: center; }
.prospect__why { color: var(--loss-ink); font-size: 12px; max-width: 26ch; }
.prospect__reports { margin: 6px 0 0; font-size: 12px; }
.prospect__story, .fprofile__story p { margin: 0; font-size: 13px; line-height: 1.45; max-width: 60ch; }
.prospect--locked .prospect__name::after { content: " (wants more rep)"; font: 400 10px/1 var(--font-pixel); color: var(--text-dim); text-transform: uppercase; }
.prospect--signed { border-color: var(--win); }
.prospect.htmx-added { animation: none; }
.stars { display: inline-flex; gap: 3px; }
.star { width: 18px; height: 18px; background: var(--surface-3); clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); transition: background var(--duration-medium) var(--ease-smooth-out); }
.stars--sm { gap: 2px; }
.stars--sm .star { width: 12px; height: 12px; }
.fcard__stars { display: inline-flex; line-height: 0; }
.fcard__foot:has(.fcard__stars) { flex-wrap: wrap; row-gap: 4px; }
.ceiling { display: grid; gap: 4px; }
.ceiling__text { margin: 0; font-size: 12px; }
.star--full { background: var(--accent-2); }
.star--maybe { background: repeating-linear-gradient(135deg, var(--accent-2) 0 2px, var(--surface-3) 2px 4px); }
.stars.is-narrowed .star { animation: pip-pop var(--duration-slow) var(--ease-bounce) both; }
@property --lo { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --hi { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --v { syntax: "<number>"; inherits: true; initial-value: 0; }
.prospect .segbar__range { transition: --lo 0.9s var(--ease-smooth-out), --hi 0.9s var(--ease-smooth-out); }
.prospect .segbar__fill { transition: --v 0.9s var(--ease-smooth-out); }
.prospect[data-scouted] .segbar__fill, .prospect[data-scouted] .segbar__range { animation: none; }

/* ---------- Promoters ---------- */
.grid--promoters { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.promoter { display: grid; gap: 8px; align-content: start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow), inset 1px 1px 0 var(--bevel-hi); }
.promoter--closed { background: var(--surface-2); border-style: dashed; }
.promoter__name { font-size: 15px; }
.promoter__head { display: flex; gap: 12px; align-items: center; }
.promoter__who { display: grid; gap: 4px; min-width: 0; }
.gym-scene, .press-room { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; line-height: 0; scrollbar-width: none; }
.gym-scene::-webkit-scrollbar, .press-room::-webkit-scrollbar { display: none; }
@media (pointer: fine) {
  .gym-scene, .press-room { scrollbar-width: thin; }
  .gym-scene::-webkit-scrollbar, .press-room::-webkit-scrollbar { display: block; height: 8px; }
  .gym-scene::-webkit-scrollbar-thumb, .press-room::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
}
.gym-scene canvas, .press-room canvas { display: block; max-width: none; margin-inline: auto; }
.promoter__note { margin: 0; font-size: 12px; }
.promoter__signed { justify-content: space-between; font-size: 13px; }
.promoter__sign select { flex: 1 1 140px; min-width: 0; max-width: 100%; }
.meterrow { display: grid; grid-template-columns: 84px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.tier .tier__s { width: 14px; height: 14px; }
.tier--lg .tier__s { width: 18px; height: 18px; }
.mine-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; min-width: 0; }
.mine-chip { min-height: 32px; padding: 6px 10px; align-items: center; gap: 8px; min-width: 0; max-width: 100%; font-size: 13px; }
.mine-chip__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-chip__rank { white-space: nowrap; }
@media (max-width: 599px) {
  .mine-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mine-chip { flex-direction: column; align-items: flex-start; gap: 2px; }
  .mine-chip__name, .mine-chip__rank { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
.rk__code--national { color: var(--text-dim); }
.fcard__foot .fcard__rating { margin-left: auto; }
.standing td { white-space: normal; vertical-align: top; }
.standing td:first-child { width: 5.5em; }
.standing__bodies { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.standing__step { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.standing__step + .standing__step, div + .standing__step { margin-top: 4px; }
[id^="rk-"] { scroll-margin-top: 90px; }
tr[id^="rk-"]:target td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.rank-champ td { background: color-mix(in oklab, var(--accent-2) 10%, var(--surface)); font-weight: 700; }

/* ---------- Mini tape, HURT beat ---------- */
.mtape { display: grid; gap: 4px; }
.mtape__t { width: 100%; background: var(--surface); border: 1px solid var(--line); }
.mtape__t th { text-align: center; font: 400 9px/1 var(--font-pixel); text-transform: uppercase; color: var(--text-dim); background: var(--surface-2); width: 5.6em; }
.mtape__t td { text-align: center !important; padding: 3px 6px; font-size: 12px; }
.mtape__t td:nth-child(1) { width: auto; } .mtape__t td:nth-child(3) { width: auto; }
.scout { display: grid; gap: 6px; }
.scout p { margin: 0; }
.scout__lines { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.scout__facts, .scout__grid { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.scout__risk--low { background: var(--win-soft); color: var(--win-ink); }
.scout__risk--high { background: var(--loss-soft); color: var(--loss-ink); }
.ring-wrap { position: relative; }
.scene-wrap { position: relative; }
.scene-pause {
  position: absolute; top: 6px; right: 6px; z-index: 6; appearance: none; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; line-height: 1; cursor: pointer;
  color: #fff; background: rgba(0, 0, 10, 0.75); border: 1px solid rgba(255, 255, 255, 0.6); border-radius: var(--radius);
}
.scene-pause[hidden] { display: none; }
.scene-pause:hover { background: rgba(0, 0, 10, 0.92); border-color: #fff; }
.scene-pause[aria-pressed="true"] .ico-pause, .scene-pause[aria-pressed="false"] .ico-play { display: none; }
.ring-round { position: absolute; top: 6px; left: 6px; z-index: 3; padding: 3px 6px; font: 400 10px/1.2 var(--font-pixel); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, 0.72); border: 1px solid rgba(255, 255, 255, 0.35); pointer-events: none; }
.ring-ringside { position: absolute; top: 6px; right: 6px; z-index: 3; padding: 3px 6px; font: 400 10px/1.2 var(--font-pixel); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, 0.72); border: 1px solid rgba(255, 255, 255, 0.35); pointer-events: none; }
.ring-ringside[hidden] { display: none; }
#ring.is-celebrating ~ .ring-ringside { visibility: hidden; }
.ring-ringside .kit-stripe { margin-inline: 5px 3px; border-color: rgba(255, 255, 255, 0.55); }
@media (max-width: 639px) { .ring-round { left: 24px; } .ring-ringside { right: 24px; } .ring-tools { padding-inline: 24px; } }
.ringside-line { margin: 0; padding: 8px 12px; }
.hurt { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; background: rgba(120, 0, 10, 0.35); opacity: 0; }
.hurt.is-on { opacity: 1; animation: hurt-flash 1s steps(2, end) both; }
.hurt__txt { font: 400 clamp(26px, 9vw, 56px)/1 var(--font-pixel); color: #fff; text-transform: uppercase; letter-spacing: 0.12em; text-shadow: 3px 3px 0 #d62f3a, 6px 6px 0 #000; animation: hurt-pop 1s var(--ease-smooth-out) both; }
@keyframes hurt-flash { 0% { background: rgba(255, 255, 255, 0.7); } 100% { background: rgba(120, 0, 10, 0.35); } }
@keyframes hurt-pop { from { transform: scale(0.5); } 30% { transform: scale(1.15); } to { transform: scale(1); } }
.ring-wrap.is-shaking { animation: ring-shake 0.8s linear both; }
@keyframes ring-shake { 0%, 100% { transform: translate(0, 0); } 10% { transform: translate(-5px, 2px); } 20% { transform: translate(5px, -3px); } 30% { transform: translate(-6px, 1px); } 40% { transform: translate(5px, 3px); } 50% { transform: translate(-4px, -2px); } 60% { transform: translate(4px, 2px); } 70% { transform: translate(-3px, 1px); } 80% { transform: translate(3px, -1px); } 90% { transform: translate(-1px, 1px); } }
.note--hurt { color: var(--loss-ink); font: 400 12px/1.4 var(--font-pixel); text-transform: uppercase; }

/* ---------- Ring on a phone: full bleed, never clipped ---------- */
@media (max-width: 639px) {
  .panel.ring-panel { margin-inline: calc(var(--gutter) * -1); border-inline-width: 0; border-radius: 0; }
  .ring-panel .panel__body { padding-inline: 0; }
  .ring-panel .ring-card { gap: 10px; }
  .ring-panel .ring-stage { justify-items: stretch; }
  .ring-panel .ring-wrap { overflow: visible; justify-self: stretch; width: 100%; max-width: none; margin-inline: 0; border-inline-width: 0; display: flex; justify-content: center; }
  .ring-panel .ring-wrap canvas { margin-inline: auto; flex: none; }
  .ring-panel .ring-side, .ring-panel .ring-controls { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene *, .ev *, .hurt, .hurt *, .chip__value--alert, .pip, .stars .star { animation: none !important; }
  .ring-wrap.is-shaking { animation: none !important; }
  .advance__line { animation: none !important; }
}

/* ---------- Footer, about ---------- */
.site-footer { max-width: var(--max-w); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; color: var(--text-dim); }
.site-footer a, .site-footer button { color: var(--text-dim); }
.site-footer a, .site-footer button { display: inline-flex; align-items: center; min-height: 24px; }
.site-footer button { appearance: none; background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.about { max-width: 560px; }
.about h2:not(:first-child, .ev__title) { margin-top: 20px; }

/* Edit dialogs */
.icon-btn--sm { width: 26px; height: 26px; font-size: 13px; }
.field-error { color: var(--loss-ink); font-size: 13px; }
.field-error .errorlist { list-style: none; margin: 0; padding: 0; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--loss); }
.nowrap { white-space: nowrap; }

/* Account button and pages */
.icon-btn--link { position: relative; display: inline-grid; place-items: center; color: var(--text); text-decoration: none; }
.icon-btn__dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--win); border: 1px solid var(--surface-2); }
.account__choice { gap: 6px; align-content: start; }
.account__email { padding: 0 12px 12px; }
.account__updates { flex-wrap: nowrap; align-items: flex-start; }
.account__passkey { display: grid; gap: 8px; }
.account__passkey + .account__passkey { padding-top: 10px; border-top: 1px solid var(--line); }
.account__passkey-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
.account__passkey-meta form { margin-left: auto; }
.account .panel__head .btn { margin-left: auto; min-height: 28px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px 10px; }
.inline-form .bar-label { flex: 0 0 100%; margin: 0; }
.inline-form input { flex: 100 1 12rem; min-width: 0; }
.inline-form .btn { flex: 1 0 auto; }
.account__glyph { color: var(--accent-2-ink); }
.account__glyph .pixel-key { width: 64px; height: 24px; }
.account .btn, .account-prompt .btn { white-space: normal; }
.account-prompt .ev__body { max-width: 100%; overflow-wrap: anywhere; }
.account-prompt .ev__options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }

@media (min-width: 1000px) {
  .account--in { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 20px; }
  .account--in > .account__wide { grid-column: 1 / -1; }
}

@media (pointer: coarse) {
  .account .btn, .account .btn--sm, .account-prompt .btn { min-height: 44px; }
  .account .panel__head .btn { min-height: 36px; }
  .account input[type="text"], .account input[type="email"] { min-height: 44px; }
}

/* Careers become stacked cards on a phone */
@media (max-width: 599px) {
  .careers, .careers tbody, .careers tr, .careers td { display: block; }
  .careers thead { display: none; }
  .careers tbody tr { display: grid; gap: 4px; padding: 12px; border-bottom: 1px solid var(--line); background: transparent; }
  .careers td, .careers td.num, .careers .lo { display: block; padding: 0; border: 0; white-space: normal; text-align: left; }
  .careers td[data-label]::before { content: attr(data-label) ": "; color: var(--text-dim); }
  .careers__name { font-weight: 700; font-size: 16px; }
  .careers__city { color: var(--text-dim); order: 0; }
  .careers__actions { margin-top: 6px; }
}
.careers__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }

/* ---------- Meter rows (morale, loyalty, discipline) ---------- */
.mrows { display: grid; gap: 10px; }
.mrow { display: grid; grid-template-columns: 124px minmax(0, 1fr) 3ch; column-gap: 8px; row-gap: 2px; align-items: center; font-size: 12px; }
.mrow__label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font: 400 10px/1 var(--font-pixel); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.mrow .segbar { min-inline-size: 0; }
.mrow__num { text-align: right; }
.mrow__note { grid-column: 2 / -1; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; color: var(--text-dim); }
.mrow__note b { color: var(--text); }
.segbar__fill[data-tone="meter-low"] { background: var(--loss); }
.segbar__fill[data-tone="meter-mid"] { background: linear-gradient(90deg, var(--accent-2), #ffc060); }
.segbar__fill[data-tone="meter-high"] { background: var(--win); }
.facility--premises, .facility--supplies { grid-column: 1 / -1; }
.facility--academy { grid-template-columns: 1fr; }
.facility--academy.is-built { border-color: var(--accent-2); }
.grid--youths { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.prospect--youth { grid-template-columns: 1fr; }
.prospect--ready { border-color: var(--win); }

/* ---------- Finances ---------- */
.fin-plot { padding-left: 46px; min-width: 0; }
.fin-frame { position: relative; }
.fin-chart { display: block; width: 100%; height: 200px; background: var(--surface-2); border: 1px solid var(--line); }
.fin-chart--cash { height: 140px; }
.fin-zero { stroke: var(--line-strong); stroke-width: 1; }
.fin-hit { fill: transparent; }
.fin-in { fill: var(--win); }
.fin-out { fill: var(--loss); }
.fin-balance { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fin-c { fill: var(--c); stroke: var(--surface-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fin-y { position: absolute; right: 100%; margin-right: 6px; transform: translateY(-50%); font-size: 10px; line-height: 1; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-end { position: absolute; transform: translate(-50%, -140%); padding: 1px 4px; font-size: 11px; font-weight: 700; line-height: 1.2; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.fin-end.is-below { transform: translate(-50%, 40%); }
.fin-end.is-first { transform: translate(0, -140%); margin-left: 4px; }
.fin-end.is-first.is-below { transform: translate(0, 40%); }
.fin-end.is-last { transform: translate(-100%, -140%); margin-left: -4px; }
.fin-end.is-last.is-below { transform: translate(-100%, 40%); }
.fin-x { position: relative; height: 16px; margin-top: 4px; }
.fin-x span { position: absolute; top: 0; transform: translateX(-50%); font-size: 10px; line-height: 1.4; color: var(--text-dim); white-space: nowrap; }
.fin-x span.is-first { left: 0 !important; transform: none; }
.fin-x span.is-last { left: auto !important; right: 0; transform: none; }
@media (max-width: 599px) { .fin-x .is-narrow-hide { display: none; } .fin-plot { padding-left: 40px; } }
.fin-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-dim); }
.fin-swatch { display: inline-block; width: 10px; height: 10px; margin-right: 6px; background: var(--c, currentColor); border: 1px solid var(--line-strong); vertical-align: -1px; }
.fin-swatch--in { --c: var(--win); }
.fin-swatch--out { --c: var(--loss); }
/* One colour per category, shared by the spending and income charts. */
.fin-c--rent { --c: hsl(0 64% 50%); }
.fin-c--wages { --c: hsl(138 64% 63%); }
.fin-c--upkeep { --c: hsl(275 64% 43%); }
.fin-c--interest { --c: hsl(53 64% 50%); }
.fin-c--camp { --c: hsl(190 64% 63%); }
.fin-c--signing { --c: hsl(328 64% 43%); }
.fin-c--bonus { --c: hsl(105 64% 50%); }
.fin-c--facilities { --c: hsl(243 64% 63%); }
.fin-c--premises { --c: hsl(20 64% 43%); }
.fin-c--academy { --c: hsl(35 80% 48%); }
.fin-c--scouting { --c: hsl(158 64% 50%); }
.fin-c--film { --c: hsl(168 64% 33%); }
.fin-c--medical { --c: hsl(295 64% 63%); }
.fin-c--bet_stake { --c: hsl(73 64% 43%); }
.fin-c--event_out { --c: hsl(210 64% 50%); }
.fin-c--other_out { --c: hsl(348 64% 63%); }
.fin-c--overhead { --c: hsl(125 64% 43%); }
.fin-c--purse { --c: hsl(263 64% 50%); }
.fin-c--win_bonus { --c: hsl(12 70% 55%); }
.fin-c--ko_bonus { --c: hsl(150 64% 38%); }
.fin-c--bet_win { --c: hsl(40 64% 63%); }
.fin-c--sponsor { --c: hsl(178 64% 43%); }
.fin-c--transfer { --c: hsl(315 64% 50%); }
.fin-c--event_in { --c: hsl(93 64% 63%); }
.fin-c--other_in { --c: hsl(230 64% 43%); }
.fin-earners { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fin-earners li { display: grid; grid-template-columns: minmax(8ch, 24ch) minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.fin-bar { height: 10px; background: var(--surface-3); border: 1px solid var(--line); }
.fin-bar i { display: block; height: 100%; background: var(--win); }
.fin-earners .num { font-weight: 700; }
@media (max-width: 479px) { .fin-earners li { grid-template-columns: minmax(0, 1fr) auto; } .fin-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Sponsors */
.brand-logo { display: inline-block; flex: none; vertical-align: middle; image-rendering: pixelated; }
.ev__brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ev__brand b { overflow-wrap: anywhere; }
.ev__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sponsor { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.sponsor + .sponsor { border-top: 1px dashed var(--line); padding-top: 10px; }
.sponsor__main { display: grid; gap: 4px; min-width: 0; }
.sponsor__nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 13px; }
.sponsor__nums div { display: grid; }
.sponsor__nums dt { color: var(--text-dim); font-size: 11px; }
.sponsor__nums dd { margin: 0; font-weight: 600; }
.sponsor-line dt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.sponsor-logos { display: inline-flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.equip__supplied { display: inline-flex; align-items: center; gap: 6px; text-align: left; white-space: normal; }
.equip.is-supplied .equip__buy { grid-column: 1 / -1; justify-items: start; text-align: left; }
.sponsor-line dd { color: var(--win-ink); flex: none; text-align: right; }
.film .bar-label { margin-bottom: 6px; }

/* ---------- Fight posters ---------- */
.poster { display: block; width: 100%; max-width: 320px; height: auto; aspect-ratio: 160 / 224; image-rendering: pixelated; border: 2px solid var(--line-strong); box-shadow: var(--shadow); background: #001; }
.poster--big { max-width: min(100%, 480px); height: auto; }
.poster--wide { max-width: 512px; aspect-ratio: 256 / 144; }
.poster--wide.poster--big { max-width: min(100%, 768px); }
.poster-card { min-width: 0; }
.poster-btn { display: block; width: 100%; max-width: 320px; padding: 0; border: 0; background: none; cursor: zoom-in; }
.poster-btn--wide { max-width: 512px; }
.poster-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.poster-fold .poster-card { display: flex; justify-content: center; }
dialog.poster-dialog { width: min(92vw, 540px); }
dialog.poster-dialog--wide { width: min(92vw, 800px); }
.poster-dialog__body { display: flex; justify-content: center; overflow: auto; max-height: calc(100dvh - 150px); }
.analysis .bar-label { margin-bottom: 10px; }
.pundit-desk { margin-bottom: 10px; }
.pundit-desk canvas { display: block; }

/* Achievements page */
.ach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.ach { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface-2); overflow-wrap: anywhere; }
.ach__name { font-weight: 700; }
.ach__meta { font-size: 13px; }
.ach--earned { border-color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 10%, var(--surface)); box-shadow: 3px 3px 0 color-mix(in oklab, var(--accent-2) 35%, transparent); }
.ach--earned .ach__meta { color: var(--accent-2-ink); font-weight: 600; }
.ach--locked, .ach--hidden { border-style: dashed; color: var(--text-dim); background: transparent; }
.ach--locked .ach__name, .ach--hidden .ach__name { font-weight: 600; }

/* Kit picker in the fighter edit dialog: native radios drawn as colour swatches. */
.kit { margin-top: 6px; }
.kit__preview { display: flex; align-items: flex-end; justify-content: center; gap: 16px; padding: 10px; background: var(--surface-3); border: 2px solid var(--line-strong); }
.kit__figure { width: 128px; height: 160px; display: block; }
.kit__group { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 6px; }
.kit__group legend { padding: 0; margin-bottom: 6px; }
.kit-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-swatch { position: relative; display: block; cursor: pointer; }
.kit-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kit-swatch__chip { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 32px; height: 32px; border: 2px solid var(--field-border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: 400 10px/1 var(--font-pixel); text-transform: uppercase; text-align: center; transition: box-shadow var(--duration-quick) var(--ease-smooth-out), border-color var(--duration-quick) var(--ease-smooth-out); }
.kit-swatch--word .kit-swatch__chip { width: auto; min-width: 32px; padding: 0 8px; }
.kit-swatch:hover .kit-swatch__chip { border-color: var(--text); }
.kit-swatch input:checked + .kit-swatch__chip { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.kit-swatch--word input:checked + .kit-swatch__chip { background: var(--accent); color: var(--accent-ink); }
.kit-swatch input:focus-visible + .kit-swatch__chip { outline: 2px solid var(--focus); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .kit-swatch__chip { transition: none; } }
