/* One running native arena occupies the measured field without reloading its frame. */
main {
  position: relative;
}
.original-arena {
  min-height: 220px;
  height: clamp(200px, 23vw, 330px);
  background: #1b1b1b;
}
.engine.arena-mounted {
  position: absolute;
  left: var(--arena-x);
  top: var(--arena-y);
  width: var(--arena-w);
  height: var(--arena-h);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  z-index: 1;
}
.engine.arena-mounted iframe {
  width: 100%;
  min-width: 0;
  height: 100%;
}
.field .panel-title output {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.section-nav button,
.subnav button {
  font-size: 0.86rem;
}
[data-view="fighters"] .page-heading .state {
  display: none;
}
.sheet-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.15fr) minmax(
      210px,
      0.95fr
    );
  grid-template-areas: "id eq stats" "attrs training stats" "save save change";
  gap: 0 1.5rem;
  background: var(--surface);
  padding: clamp(16px, 2.5vw, 36px);
  border-top: 3px solid var(--accent);
  align-content: start;
}
.sheet-layout > section {
  padding: 0.65rem 0 1.1rem;
  min-width: 0;
  border-top: 1px solid var(--edge);
}
.sheet-layout h3 {
  font-size: 1.3rem;
  margin-bottom: 0.7rem;
}
.sheet-layout .identity {
  grid-area: id;
  padding: 0 0 1rem;
}
.equip-section {
  grid-area: eq;
}
.values-section {
  grid-area: stats;
}
.abilities-section {
  grid-area: attrs;
}
.training-section {
  grid-area: training;
}
.save-section {
  grid-area: save;
}
.changes-section {
  grid-area: change;
}
.sheet-portrait {
  width: clamp(88px, 10vw, 155px);
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.initials {
  background: var(--raised);
  font: 600 3rem var(--display);
  display: grid;
  place-content: center;
}
.identity-text {
  margin-top: 0.55rem;
}
.identity-text > span {
  font-size: 0.82rem;
  color: var(--muted);
}
.identity-text h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.3rem);
  line-height: 1.08;
  margin: 0.25rem 0;
}
.identity-text p {
  font-size: 0.87rem;
}
.record-links,
.shortcut div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.sheet-layout label {
  display: block;
  font-size: 0.87rem;
  color: var(--muted);
  margin: 0.45rem 0 0.25rem;
}
.choice-line {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}
.choice-line input,
.choice-line select {
  min-width: 0;
  flex: 1;
}
.choice-line button {
  border-color: var(--accent);
}
.paper-link {
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--accent);
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0.2rem 0;
  min-height: 28px;
  text-align: left;
}
.record-links {
  margin-top: 0.65rem;
}
.records,
.compare-sheet {
  width: 100%;
  border-collapse: collapse;
}
.records th,
.records td,
.compare-sheet th,
.compare-sheet td {
  border-bottom: 1px solid var(--edge);
  padding: 0.32rem 0;
  text-align: left;
  vertical-align: top;
}
.records th,
.compare-sheet tbody th {
  font-weight: 400;
  color: var(--muted);
}
.records td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.attributes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem 0.3rem;
  margin: 0.5rem 0;
}
.attributes dt {
  font:
    500 0.78rem Plex,
    monospace;
  color: var(--muted);
}
.attributes dd {
  font: 600 1.35rem var(--display);
  margin: 0;
}
#training > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  border-bottom: 1px solid var(--edge);
  padding: 0.25rem 0;
}
#training span {
  font-size: 0.88rem;
  text-align: right;
}
#saved {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 0.45rem;
}
.facing {
  padding: 1rem 2rem;
  background: var(--surface);
  border-top: 2px solid var(--accent);
}
.compare-sheet caption {
  text-align: left;
  font: 600 1.5rem var(--display);
  padding-bottom: 1rem;
}
.compare-sheet td,
.compare-sheet thead th {
  width: 32%;
  font-variant-numeric: tabular-nums;
}
.compare-sheet .sheet-portrait {
  max-width: 80px;
}
.compare-sheet .paper-link {
  font: 600 1.2rem var(--display);
  margin: 0.45rem 0;
}
@media (min-width: 1040px) {
  body:is(
      [data-layout="dossier"],
      [data-layout="north"],
      [data-layout="boons"]
    )[data-view="fighters"]
    main
    > #sheet {
    grid-column: 2;
  }
}
@media (max-width: 1140px) {
  .sheet-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "id eq" "stats attrs" "stats training" "save change";
  }
}
@media (max-width: 650px) {
  .sheet-layout {
    display: flex;
    flex-direction: column;
    padding: 1rem;
  }
  .identity {
    display: flex;
    gap: 0.9rem;
    align-items: center;
  }
  .sheet-portrait {
    width: 80px;
  }
  .sheet-layout .identity-text {
    margin: 0;
  }
  .facing {
    padding: 1rem;
  }
  .section-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .section-nav button {
    flex-shrink: 0;
  }
  .values-section {
    order: 1;
  }
  .save-section {
    order: 2;
  }
  .changes-section {
    order: 3;
  }
  .engine.arena-mounted iframe {
    min-width: 0;
  }
}
