.battle-lineup {
  margin-block: 0 14px;
  padding: clamp(12px, 2.3vw, 24px);
  border-color: #92714d;
  background: linear-gradient(117deg, #312419, #211b16 62%);
}

.battle-lineup-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.battle-lineup-top > div:first-child { min-width: 0; flex: 1 1 180px; display: grid; gap: 4px; }
.battle-lineup-label { color: #efc17c; font-size: .75rem; }
.battle-lineup-top strong { color: #fff1d9; font: 800 clamp(19px, 2vw, 25px)/1.14 var(--serif); overflow-wrap: anywhere; }
.battle-lineup-top small, .lineup-preview-note { color: #cfb89a; }
.battle-lineup-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.battle-lineup-counts > div { min-width: 64px; padding: 5px 8px; text-align: center; border: 1px solid #6e553a; border-radius: 6px; background: #211911; }
.battle-lineup-counts dt { color: #e3c5a1; font-size: .7rem; }
.battle-lineup-counts dd { margin: 0; color: #f8ce91; font: 800 1.18rem/1.2 var(--numbers); }
.battle-lineup-counts div:last-child { border-color: #bc8d55; }
.lineup-preview-note { margin: 14px 0 8px; font-size: .82rem; }
.lineup-hand-preview { width: min(100%, 490px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(4px, 1.5vw, 10px); }
.lineup-preview-card {
  position: relative;
  display: grid;
  align-items: end;
  min-width: 0;
  padding: 5px;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  border: 1px solid #d3a96c;
  border-radius: 7px;
  color: #fff2d6;
  background: linear-gradient(0deg, #180e0cf2 8%, transparent 58%), var(--portrait) center / cover;
  text-align: start;
}
.lineup-preview-card strong { position: relative; font: 750 clamp(11px, 1.5vw, 15px)/1.12 var(--serif); overflow-wrap: anywhere; text-shadow: 0 1px 3px #160d09; }
.lineup-preview-cost { position: absolute; inset: 4px auto auto 4px; min-width: 16px; color: #ffe7bf; background: #251710; border: 1px solid #b68851; border-radius: 3px; text-align: center; font: 800 11px/1.2 var(--numbers); }
.lineup-sandbox { margin-top: 15px; }
.lineup-sandbox > summary { padding: 10px; color: #e7c38c; cursor: pointer; }

@media (max-width: 580px) {
  .battle-lineup-top { gap: 9px; }
  .battle-lineup-top > div:first-child { flex-basis: 100%; }
  .battle-lineup-top > .btn { margin-inline-start: auto; }
  .battle-lineup-counts { gap: 4px; }
  .battle-lineup-counts > div { min-width: 51px; padding-inline: 4px; }
}

.presentation-workbench {
  --wb-ink: #f9ebd3;
  --wb-muted: #c4ad8d;
  --wb-paper: #241713;
  --wb-frame: #765334;
  --wb-gold: #e1b16e;
  --wb-active: #ffce81;
  box-sizing: border-box;
  max-width: 1470px;
  margin: 0 auto;
  padding: clamp(14px, 2.6vw, 36px);
  color: var(--wb-ink);
  color-scheme: dark;
}

.wb-heading,
.wb-toolbar,
.wb-zone-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.wb-heading,
.wb-zone-head {
  justify-content: space-between;
}

.wb-heading {
  gap: 16px;
  padding-bottom: 16px;
}

.wb-heading h1,
.wb-inspector h2,
.wb-inspector h3 {
  margin: 0;
  color: var(--wb-ink);
}

.wb-heading p,
.wb-json p {
  margin: 7px 0 0;
  color: var(--wb-muted);
}

.wb-heading h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 650;
}

.wb-workarea {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: 14px;
  align-items: start;
}

.wb-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.wb-zone,
.wb-inspector {
  min-width: 0;
  border: 1px solid var(--wb-frame);
  border-radius: 12px;
  background: var(--wb-paper);
}

.wb-zone {
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0, #442e20, #201511 90%);
}

.wb-zone-grid {
  grid-column: 1 / -1;
}

.wb-zone[data-selected="true"] {
  border-color: var(--wb-gold);
}

.wb-zone.is-drop-legal {
  border-color: #b8ab5c;
}

.wb-zone.is-drop-hover {
  border-color: #ffe097;
  box-shadow: inset 0 0 32px #c58a3b49;
}

.wb-zone-head {
  min-height: 42px;
  padding: 4px 12px;
  border-bottom: 1px solid #94704c45;
  font-size: .8rem;
  color: var(--wb-muted);
}

.wb-zone-head .wb-action {
  max-width: 100%;
  min-height: 31px;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  color: var(--wb-ink);
  font-size: .95rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-zone-head .wb-action[aria-pressed="true"] {
  color: var(--wb-active);
}

.wb-surface {
  --wb-card-width: min(var(--wb-size), 22vw);
  --wb-row-height: calc(var(--wb-card-width) * 1.4 + 17px);
  position: relative;
  min-height: 155px;
  height: calc(85px + var(--wb-rows) * var(--wb-row-height));
  margin: 0 clamp(13px, 2.2vw, 28px) 6px;
}

.wb-zone-grid .wb-surface {
  --wb-card-width: min(var(--wb-size), 18vw);
  height: calc(44px + var(--wb-rows) * var(--wb-row-height));
}

.wb-empty {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--wb-muted);
  font-size: .85rem;
}

.wb-card {
  position: absolute;
  z-index: var(--wb-layer);
  top: calc(44px + var(--wb-y) + var(--wb-row) * var(--wb-row-height));
  left: calc(var(--wb-x) * (100% - var(--wb-card-width)) + var(--wb-dx));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: start;
  width: var(--wb-card-width);
  aspect-ratio: 2.5 / 3.5;
  padding: 7px 5px;
  overflow: hidden;
  border: 1px solid #b28650;
  border-radius: 8px;
  background: #38231d;
  color: #fff3d6;
  transform: rotate(var(--wb-rotate));
  box-shadow: 0 4px 11px #080503bc;
  isolation: isolate;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wb-zone-grid .wb-card {
  top: calc(19px + var(--wb-y) + var(--wb-row) * var(--wb-row-height));
}

.wb-card[data-drag-source] {
  touch-action: none;
  cursor: grab;
}

.wb-card:is([aria-pressed="true"], :hover, :focus-visible, .is-drop-hover) {
  z-index: 30;
  border-color: #ffdf95;
  outline: 2px solid #ffdf95;
  outline-offset: 1px;
}

.wb-card.is-drop-legal {
  border-color: #f9c454;
}

.wb-card.is-drag-source {
  opacity: .35;
}

.wb-card-front::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(transparent 42%, #170d09df 75%, #170d09 100%);
  content: "";
}

.wb-art {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  pointer-events: none;
}

.wb-card-name {
  max-width: 100%;
  overflow: hidden;
  font-size: .78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-card-domain {
  max-width: 100%;
  overflow: hidden;
  color: #e1c69c;
  font-size: .61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-card-cost,
.wb-card-might {
  position: absolute;
  top: 4px;
  display: grid;
  min-width: 17px;
  min-height: 17px;
  padding-inline: 2px;
  place-items: center;
  border: 1px solid #d4a96c;
  border-radius: 3px;
  background: #221610ed;
  color: #ffe6aa;
  font-size: .66rem;
  font-weight: 700;
}

.wb-card-cost { left: 4px; }
.wb-card-might { right: 4px; }

.wb-card-back {
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, #50221e 0 8px, #4a201e 8px 16px);
}

.wb-card-back::before {
  position: absolute;
  inset: 6px;
  border: 1px solid #bf8755;
  border-radius: 5px;
  content: "";
}

.wb-card-seal {
  padding: 3px;
  border: 1px solid #cc9870;
  color: #ebc480;
  font-family: "Songti SC", STSong, SimSun, serif;
  font-size: .95rem;
  letter-spacing: .03em;
}

.arena-drag-ghost .wb-card {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  transform: none;
  opacity: .97;
}

.wb-inspector {
  padding: 13px;
  font-size: .87rem;
}

.wb-inspector h2 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.wb-inspector h3 {
  margin-bottom: 6px;
  font-size: .93rem;
}

.wb-inspector label {
  display: grid;
  grid-template-columns: minmax(66px, auto) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin-bottom: 7px;
}

.wb-inspector .wb-checkbox {
  display: flex;
  width: fit-content;
}

.wb-inspector .wb-range {
  grid-template-columns: minmax(68px, auto) minmax(0, 1fr) 26px;
}

.wb-range output {
  color: var(--wb-active);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.wb-action,
.wb-inspector :is(input:not([type="range"], [type="checkbox"]), select, textarea) {
  box-sizing: border-box;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #865e3e;
  border-radius: 5px;
  background: #35241c;
  color: var(--wb-ink);
  font: inherit;
}

.wb-action {
  cursor: pointer;
}

.wb-action:hover:not(:disabled) {
  border-color: var(--wb-gold);
  background: #523525;
}

.wb-action:disabled {
  opacity: .55;
  cursor: default;
}

.wb-inspector input:is([type="range"], [type="checkbox"]) {
  margin: 0;
  accent-color: var(--wb-gold);
}

.wb-inspector summary {
  color: var(--wb-active);
  cursor: pointer;
}

.wb-meta,
.wb-json {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #8b654648;
}

.wb-meta > select {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

.wb-json textarea {
  display: block;
  width: 100%;
  margin: 8px 0;
  resize: vertical;
  font: .78rem ui-monospace, Consolas, monospace;
}

.wb-feedback {
  position: sticky;
  z-index: 35;
  bottom: 12px;
  width: fit-content;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 7px 12px;
  border: 1px solid var(--wb-frame);
  border-radius: 7px;
  background: #2f231b;
  color: #ffe7ab;
  font-size: .86rem;
}

.wb-feedback:empty { display: none; }
.wb-feedback[data-error="true"] { color: #ffc5ac; }

@media (max-width: 1020px) {
  .wb-workarea { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 570px) {
  .wb-board { grid-template-columns: minmax(0, 1fr); }
  .wb-heading { padding-bottom: 12px; }
  .wb-surface { --wb-card-width: min(var(--wb-size), 26vw); }
  .wb-zone-grid .wb-surface { --wb-card-width: min(var(--wb-size), 22vw); }
}
