:root {
  color-scheme: light;
  --paper: #f4efe4;
  --ink: #262923;
  --muted: #585a51;
  --line: #cbc3b3;
  --red: #813b2d;
  --teal: #205650;
  --hurt: #b2e5f6;
  --guard: #ffe181;
  --strike: #ff704e;
  font: 16px/1.4 "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(100%, 1032px); margin: 0 auto; padding: 26px clamp(12px, 3vw, 32px) 36px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--red); font-weight: 650; text-underline-offset: 3px; }
header { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 12px 0 20px; }
h1 { margin: 0; font: 650 clamp(2rem, 5vw, 3.65rem)/1.04 "STIX Two Text", "Songti SC", "Noto Serif CJK SC", Georgia, serif; }
.action-picker { display: grid; gap: 4px; width: min(100%, 310px); font-size: .875rem; font-weight: 650; }
button, select, input { font: inherit; }
button, select { color: var(--ink); background: #fbf9f1; border: 1px solid #a69c8a; border-radius: 5px; min-height: 39px; padding: 7px 12px; }
button, select, input:not(:disabled) { cursor: pointer; }
button:disabled, select:disabled, fieldset:disabled { opacity: .65; }
button:not(:disabled):hover, select:not(:disabled):hover { border-color: var(--ink); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, canvas:focus-visible { outline: 3px solid #166575; outline-offset: 3px; }
select { min-width: 0; max-width: 100%; }
figure { margin: 0; }
.roster { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin: 0 2px 8px; font-weight: 650; }
.roster > span:last-child { text-align: end; }
.roster b { color: var(--red); font-size: .82em; white-space: nowrap; }
.roster [data-slot="p2"] b, .roster #right-name:not([data-slot]) b { color: var(--teal); }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; background: #d1c2aa; border-radius: 6px; }
figcaption { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; min-height: 44px; padding: 10px 1px 12px; border-bottom: 1px solid var(--line); }
#detail, #time { font-variant-numeric: tabular-nums; }
#detail { color: var(--muted); font-size: .9rem; }
fieldset { min-width: 0; margin: 14px 0 0; border: 0; padding: 0; }
.transport, .options { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.transport input { flex: 1 1 130px; min-width: 0; min-height: 34px; accent-color: var(--red); }
#play { min-width: 90px; color: white; background: var(--red); border-color: var(--red); font-weight: 650; }
.options { margin-top: 12px; gap: 8px 20px; }
.options label { display: inline-flex; align-items: center; gap: 6px; min-height: 39px; cursor: pointer; }
.options input { width: 1.1em; height: 1.1em; margin: 0; accent-color: var(--teal); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; color: var(--muted); list-style: none; font-size: .88rem; }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 1.15em; height: .78em; border: 3px solid; background: #222; }
.legend .hurt { border-color: var(--hurt); }
.legend .guard { border-color: var(--guard); }
.legend .strike { border-color: var(--strike); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 620px) {
  main { padding-top: 12px; }
  header { align-items: stretch; flex-direction: column; gap: 12px; margin: 8px 0 15px; }
  .action-picker { width: 100%; }
  .roster, .options, figcaption { font-size: .875rem; }
  .transport { gap: 6px; }
  .transport input { flex-basis: 100%; order: -1; }
  .transport button { flex: 1 1 auto; min-width: 0; padding-inline: 7px; }
  button, select, .options label { min-height: 44px; }
  .options { gap: 5px 14px; }
  #play { min-width: 0; }
}
