:root {
  --bg: #f5f8f6;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-soft: #edf3ef;
  --text: #17201b;
  --muted: #68746d;
  --subtle: #96a29b;
  --line: #dce5df;
  --line-strong: #c8d6cd;
  --green: #16a36a;
  --green-soft: #e7f6ed;
  --blue: #3275d7;
  --blue-soft: #eaf2ff;
  --red: #d95362;
  --red-soft: #fff0f2;
  --shadow: 0 18px 55px rgba(27, 49, 37, 0.07);
  --hero-size: 52px;
  --hero-gap: 7px;
  --draft-side-width: 260px;
  --pick-size: 80px;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { min-width: 680px; }

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(24, 163, 106, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 163, 106, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

body.dark {
  --bg: #111714;
  --surface: rgba(25, 33, 29, 0.94);
  --surface-solid: #1a221e;
  --surface-soft: #222c27;
  --text: #eef5f0;
  --muted: #adb9b1;
  --subtle: #7f8c84;
  --line: #303c35;
  --line-strong: #415047;
  --green-soft: #173b2b;
  --blue-soft: #192f50;
  --red-soft: #48252b;
  --shadow: none;
}

body.exporting-board {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-soft: #f2f6f3;
  --text: #17201b;
  --muted: #68746d;
  --subtle: #96a29b;
  --line: #dce5df;
  --line-strong: #c8d6cd;
}

body.exporting-board .tile-control,
body.exporting-board .lane-hide-drop,
body.exporting-board .priority-slot-remove,
body.exporting-board .priority-add-hint { display: none; }

body.result-mode .app-header { display: none; }

body[data-size="small"] { --hero-size: 42px; --hero-gap: 5px; }
body[data-size="medium"] { --hero-size: 52px; --hero-gap: 7px; }
body[data-size="large"] { --hero-size: 64px; --hero-gap: 9px; }

button, input { font: inherit; }
button { color: inherit; }

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(320px, 1fr);
  align-items: center;
  min-height: 68px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.back-link {
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover { color: var(--green); }

.mode-switch, .size-switch {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.mode-button, .size-switch button {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.mode-button.active, .size-switch button.active {
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: 0 2px 10px rgba(25, 50, 35, 0.07);
}

.header-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  width: 170px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-solid);
}

.search-box span {
  margin-right: 8px;
  color: var(--subtle);
  font-size: 11px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 12px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 17px;
}

main { padding: 0 22px 32px; }

.workspace {
  display: none;
  width: min(1660px, 100%);
  margin: 0 auto;
}

.workspace.active { display: block; }

.workspace-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 34px 2px 20px;
}

.workspace-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-height: 54px;
}

.workspace-heading h1 {
  margin: 5px 0 6px;
  font-size: 28px;
  line-height: 1.15;
}

.workspace-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.compact-heading { padding-top: 22px; }
.kicker { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; }

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.status-text { color: var(--subtle); font-size: 11px; }

.secondary-button, .icon-text-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.primary-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 7px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.primary-button:disabled {
  border-color: var(--line-strong);
  color: var(--subtle);
  background: var(--surface-soft);
  cursor: not-allowed;
  box-shadow: none;
}

#showBpPhoto.ready { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent); }

.secondary-button:hover, .icon-text-button:hover { border-color: var(--green); }
.danger-button:hover { border-color: var(--red); color: var(--red); }

.mirror-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.team-board { min-width: 0; padding: 16px; }
.red-board .team-heading { flex-direction: row; text-align: left; }

.team-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  min-height: 58px;
  padding: 0 4px 12px;
  border-bottom: 1px solid var(--line);
}

.team-heading div { display: grid; gap: 2px; }
.team-heading span { color: var(--subtle); font-size: 9px; font-weight: 800; letter-spacing: 0.12em; }
.team-heading strong { outline: none; font-size: 19px; }
.team-heading em { color: var(--muted); font-size: 11px; font-style: normal; }

.team-heading .team-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.yuanliu-token {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  cursor: pointer;
}

.yuanliu-token img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}

.yuanliu-token.used img { filter: grayscale(1); opacity: 0.35; }
.yuanliu-token.used::after {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 39px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  content: "";
  transform: rotate(-38deg);
}

.team-heading .priority-dock {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.priority-slot {
  position: relative;
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
  overflow: hidden;
  color: var(--subtle);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.priority-slot:hover,
.priority-slot:focus-visible,
.priority-slot.drag-over { border-color: var(--green); background: var(--green-soft); outline: 0; }
.priority-slot:hover { transform: translateY(-1px); }
.priority-slot.active { border-style: solid; border-color: var(--green); }
.priority-slot.active .priority-portraits { filter: grayscale(1); opacity: 0.32; }
.priority-portraits { display: grid; width: 100%; height: 100%; }
.priority-slot.combo .priority-portraits { grid-template-columns: 1fr 1fr; }
.priority-portraits img { width: 100%; height: 100%; min-width: 0; object-fit: cover; }
.priority-slot.combo .priority-portraits img:first-child { object-position: 38% center; }
.priority-slot.combo .priority-portraits img:last-child { object-position: 62% center; }
.priority-empty { font-size: 15px; font-weight: 600; }
.priority-add-hint {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  color: #fff;
  background: rgba(18, 24, 20, 0.7);
  font-size: 10px;
  line-height: 1;
}
.priority-slot-remove {
  position: absolute;
  z-index: 2;
  top: 1px;
  right: 1px;
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: rgba(20, 26, 22, 0.78);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease;
}
.priority-slot:hover .priority-slot-remove,
.priority-slot:focus-within .priority-slot-remove { opacity: 1; }
.priority-slot-remove:hover { background: var(--red); }

.team-heading .team-controls { display: flex; align-items: center; gap: 8px; }
.red-board .team-controls { flex-direction: row-reverse; }

.board-divider {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 20px;
  color: var(--subtle);
  background: linear-gradient(90deg, var(--blue-soft) 0 50%, var(--red-soft) 50% 100%);
  font-size: 9px;
  font-weight: 900;
  writing-mode: vertical-rl;
}

.hero-groups { display: grid; gap: 16px; padding-top: 16px; }

.hero-group { min-width: 0; }
.red-board .hero-group-title { flex-direction: row-reverse; }

.hero-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.hero-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.hero-tiers { display: grid; gap: 5px; }

.hero-tier {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-height: calc(var(--hero-size) + 10px);
  padding: 5px;
  border: 1px dashed transparent;
  border-radius: 6px;
  transition: border-color 120ms ease, background 120ms ease;
}

.tier-label {
  display: grid;
  flex: 0 0 18px;
  place-items: center;
  min-height: var(--hero-size);
  color: var(--subtle);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.hero-tier.empty {
  min-height: 20px;
  padding-block: 1px;
  border-color: var(--line);
  opacity: 0.62;
}
.hero-tier.empty .tier-label { min-height: 16px; }
.hero-tier.drag-over { border-color: var(--green); background: var(--green-soft); }
.hero-tier-list { display: flex; flex: 1; flex-wrap: wrap; gap: var(--hero-gap); min-width: 0; }
.hero-tier .hero-tile { flex: 0 0 var(--hero-size); width: var(--hero-size); }

.lane-hide-drop {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 22px;
  margin-top: 4px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  color: var(--subtle);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.lane-hide-drop:hover,
.lane-hide-drop.drag-over { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.lane-hide-drop.has-items { border-style: solid; }
.lane-hide-drop strong { font-size: 9px; }

.hero-tile {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-soft);
  cursor: pointer;
  transition: opacity 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.hero-tile:hover { z-index: 2; transform: translateY(-1px); border-color: var(--green); }
.blue-board .hero-tile:hover { border-color: var(--blue); }
.red-board .hero-tile:hover { border-color: var(--red); }
.hero-tile.dragging { opacity: 0.25; }

.hero-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-tile.dimmed img { filter: grayscale(1); opacity: 0.2; }
.hero-tile.dimmed::after { content: ""; position: absolute; inset: 0; background: rgba(25, 32, 28, 0.18); }

.hero-tile mark {
  position: absolute;
  inset: auto 2px 2px;
  padding: 2px 3px;
  border-radius: 3px;
  color: #fff;
  background: rgba(18, 24, 20, 0.76);
  font-size: 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-control {
  position: absolute;
  z-index: 3;
  top: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  color: #fff;
  background: rgba(18, 24, 20, 0.78);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease;
}

.hero-actions-control { right: 2px; }
.remove-copy-control { left: 2px; }
.hero-tile:hover .tile-control,
.hero-tile:focus-visible .tile-control { opacity: 1; }
.hero-actions-control:hover { background: var(--green); }
.remove-copy-control:hover { background: var(--red); }

.hero-action-menu {
  position: fixed;
  z-index: 80;
  display: grid;
  min-width: 118px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-solid);
  box-shadow: 0 10px 28px rgba(20, 38, 27, 0.16);
}

.hero-action-menu button {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}
.hero-action-menu button:hover { color: var(--green); background: var(--green-soft); }

.simulator-shell {
  display: grid;
  grid-template-columns: var(--draft-side-width) 8px minmax(320px, 1fr) 8px var(--draft-side-width);
  gap: 4px;
  min-height: calc(100vh - 82px);
  padding-top: 14px;
}

.side-resizer {
  position: relative;
  cursor: col-resize;
  touch-action: none;
}

.side-resizer::after {
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: var(--line-strong);
  content: "";
}

.side-resizer:hover::after,
.side-resizer.dragging::after { background: var(--green); }

.draft-side, .draft-center {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.draft-side { container-type: inline-size; padding: 12px; }
.draft-side-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 12px; }
.red-draft .draft-side-title { flex-direction: row-reverse; }
.draft-side-title span { color: var(--subtle); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; }
.draft-side-title strong { font-size: 16px; }

.ban-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-bottom: 16px; }
.ban-row .draft-slot:nth-child(1) { grid-column: 2 / span 2; }
.ban-row .draft-slot:nth-child(2) { grid-column: 4 / span 2; }
.ban-row .draft-slot:nth-child(n + 3) { grid-column: span 2; }
.pick-column { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 7px; }

.draft-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  cursor: pointer;
  overflow: hidden;
}

.ban-row .draft-slot { aspect-ratio: 1; }
.pick-column .draft-slot { width: var(--pick-size); height: var(--pick-size); min-height: 0; }
.draft-slot.active { outline: 2px solid var(--green); outline-offset: 2px; }
.blue-draft .draft-slot.active { outline-color: var(--blue); }
.red-draft .draft-slot.active { outline-color: var(--red); }
.draft-slot.filled { cursor: grab; }
.draft-slot.dragging { opacity: 0.45; cursor: grabbing; }
.draft-slot.drag-over {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-color: var(--green);
}

.draft-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}
.pick-column .draft-slot img { width: 100%; height: 100%; flex: none; }
.draft-slot .slot-empty { color: var(--subtle); font-size: 10px; }

.draft-center { min-width: 0; padding: 14px; }
.draft-progress { display: grid; grid-template-columns: minmax(140px, 190px) 1fr auto; align-items: center; gap: 14px; padding: 0 2px 12px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; }
.draft-progress span, .draft-progress strong { font-size: 11px; }
.draft-progress span { color: var(--muted); }
.progress-track { height: 4px; border-radius: 999px; overflow: hidden; background: var(--surface-soft); }
.progress-track span { display: block; width: 5%; height: 100%; background: var(--green); transition: width 180ms ease; }

.simulator-actions { display: flex; gap: 6px; }
.simulator-actions .secondary-button,
.simulator-actions .icon-text-button { min-height: 32px; padding-inline: 10px; }

.lane-filters { display: flex; gap: 6px; padding: 8px 0 12px; border-top: 1px solid var(--line); }
.lane-filter {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.lane-filter.active { border-color: var(--green); color: var(--green); background: var(--green-soft); }

.draft-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--hero-size), 1fr));
  gap: var(--hero-gap);
  max-height: calc(100vh - 276px);
  padding-right: 3px;
  overflow-y: auto;
}

.draft-pool .hero-tile.used { opacity: 0.18; pointer-events: none; }

.result-toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 62px;
}
.result-toolbar > :last-child { justify-self: end; }
.result-toolbar strong { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; }
.result-toolbar-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.drawing-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.draw-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.draw-button:hover,
.draw-button.active { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.draw-button.red-pen.active { border-color: var(--red); color: var(--red); }
.draw-button.blue-pen.active { border-color: var(--blue); color: var(--blue); }
.draw-button kbd {
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  color: var(--subtle);
  background: var(--surface);
  font-family: inherit;
  font-size: 9px;
  line-height: 1;
}

.shortcut-settings {
  position: relative;
}

.shortcut-settings summary {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}

.shortcut-settings summary::-webkit-details-marker { display: none; }
.shortcut-settings summary:hover { background: var(--surface); color: var(--text); }
.shortcut-settings[open] summary { background: var(--surface); color: var(--green); }
.shortcut-panel {
  position: absolute;
  z-index: 35;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.shortcut-settings label {
  display: inline-grid;
  grid-template-columns: auto 28px;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.shortcut-settings input {
  width: 26px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: var(--surface);
  text-align: center;
  font: inherit;
  font-weight: 850;
  text-transform: uppercase;
}

.result-stage {
  display: grid;
  grid-template-columns: minmax(132px, 190px) minmax(340px, 1fr) minmax(132px, 190px);
  align-items: stretch;
  gap: 22px;
  min-height: calc(100vh - 150px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.result-team { display: grid; align-content: center; min-width: 0; }
.result-team-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.result-team-title span { color: var(--subtle); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; }
.result-team-title strong { font-size: 22px; }
.result-rails { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-rail { min-width: 0; }
.result-rail > span { display: block; margin-bottom: 6px; color: var(--subtle); font-size: 8px; font-weight: 850; letter-spacing: 0.1em; }
.result-bans,
.result-picks { display: grid; gap: 7px; }
.result-portrait,
.result-empty { width: 100%; aspect-ratio: 1; border-radius: 6px; }
.result-portrait { display: block; border: 1px solid var(--line); object-fit: cover; }
.result-portrait.ban { filter: grayscale(0.85); opacity: 0.55; }
.result-portrait.pick { cursor: grab; touch-action: none; }
.result-portrait.pick:hover { border-color: var(--green); }
.result-portrait.pick.selected { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }
.result-portrait.dragging { opacity: 0.35; }
.result-empty { display: grid; place-items: center; border: 1px dashed var(--line); color: var(--subtle); background: var(--surface-soft); font-size: 9px; }

.result-map-shell {
  position: relative;
  align-self: center;
  width: min(100%, calc(100vh - 155px));
  aspect-ratio: 1;
  justify-self: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #dbe7dc;
  box-shadow: 0 14px 40px rgba(23, 45, 31, 0.12);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.result-map-shell.drag-over,
.result-map-shell.awaiting-placement { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }
.result-map-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.result-drawing-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.result-map-markers { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.result-map-shell.drawing-active { cursor: crosshair; }
.result-map-hint {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 50%;
  max-width: calc(100% - 20px);
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(18, 31, 23, 0.58);
  font-size: 9px;
  transform: translateX(-50%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.map-hero-marker {
  position: absolute;
  width: 38px;
  height: 38px;
  padding: 2px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: #fff;
  cursor: move;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(12, 24, 17, 0.3);
  touch-action: none;
}

.map-hero-marker.red { border-color: var(--red); }
.map-hero-marker img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.map-hero-marker,
.map-hero-marker img { user-select: none; -webkit-user-drag: none; }
.map-hero-marker.dragging { opacity: 0.4; }

.result-drag-ghost {
  position: fixed;
  z-index: 100;
  width: 46px;
  height: 46px;
  border: 2px solid var(--green);
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.82;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(12, 24, 17, 0.28);
}

.photo-tools {
  justify-content: space-between;
  padding-top: 12px;
}

.bp-photo-stage {
  --photo-ban-size: 54px;
  --photo-ban-base-top: 58px;
  --photo-pick-base-top: 30px;
  --photo-ban-offset: 0px;
  --photo-pick-offset: 0px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 86px minmax(240px, 1fr);
  gap: 14px;
  min-height: calc(100vh - 150px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--blue-soft) 50%, transparent), transparent 35%),
    linear-gradient(270deg, color-mix(in srgb, var(--red-soft) 58%, transparent), transparent 35%),
    var(--surface);
  box-shadow: var(--shadow);
}

.bp-photo-team {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
}

.photo-red { text-align: right; }

.bp-photo-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 14px;
}

.photo-red .bp-photo-title { flex-direction: row-reverse; }
.bp-photo-title span { color: var(--subtle); font-size: 10px; font-weight: 850; letter-spacing: 0.12em; }
.bp-photo-title strong { font-size: 24px; }

.bp-photo-bans {
  position: absolute;
  z-index: 3;
  top: calc(var(--photo-ban-base-top) + var(--photo-ban-offset));
  left: 16px;
  display: flex;
  gap: 6px;
  align-items: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.bp-photo-picks {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(78px, 1fr));
  align-items: end;
  align-content: start;
  gap: 12px;
  padding-top: calc(var(--photo-pick-base-top) + var(--photo-pick-offset));
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.bp-photo-bans:active,
.bp-photo-picks:active,
.bp-photo-bans.dragging,
.bp-photo-picks.dragging { cursor: grabbing; }

.bp-photo-card {
  position: relative;
  display: grid;
  align-content: end;
  gap: 7px;
  min-width: 0;
}

.photo-pick-main,
.photo-empty {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 7px;
}

.photo-pick-main {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.photo-pick-main img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-pick-main span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 850;
}

.bp-photo-bans .photo-portrait,
.bp-photo-bans .photo-empty {
  flex: 0 0 var(--photo-ban-size);
  width: var(--photo-ban-size);
  height: var(--photo-ban-size);
  min-width: var(--photo-ban-size);
  max-width: var(--photo-ban-size);
  padding: 0;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
}

.bp-photo-bans .photo-portrait {
  display: block;
  border: 1px solid var(--line-strong);
  object-fit: cover;
}

.bp-photo-bans .photo-portrait.ban {
  width: var(--photo-ban-size);
  height: var(--photo-ban-size);
  filter: grayscale(0.9);
  opacity: 0.55;
}

.bp-photo-bans .photo-empty {
  font-size: 9px;
}

.bp-photo-bans > :nth-child(3) {
  margin-left: 16px;
}

.bp-photo-card strong {
  display: block;
  min-height: 16px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  color: var(--subtle);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 800;
}

.bp-photo-center {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--subtle);
  font-weight: 900;
  letter-spacing: 0.16em;
}

.bp-photo-center span {
  writing-mode: vertical-rl;
  font-size: 10px;
}

.bp-photo-center strong {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--green);
  background: var(--surface-solid);
  letter-spacing: 0;
}

.map-demo-stage {
  grid-template-columns: minmax(480px, 1fr) minmax(280px, 360px);
  align-items: start;
  gap: 14px;
  min-height: calc(100vh - 138px);
  padding: 16px;
}

.map-demo-stage .result-map-shell {
  align-self: start;
  width: min(100%, calc(100vh - 138px));
  max-width: 920px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.map-selector-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
}

.map-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.map-panel-head span {
  display: block;
  margin-bottom: 3px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.map-panel-head strong { font-size: 18px; }

.map-team-switch {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.map-team-switch button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.map-team-switch button.active {
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: 0 2px 10px rgba(25, 50, 35, 0.06);
}

.map-slot-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.map-slot {
  position: relative;
}

.map-slot-main {
  display: grid;
  grid-template-columns: 58px 46px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.map-slot.active .map-slot-main,
.map-slot-main:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.map-slot-lane {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-slot-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-soft);
}

.map-slot-avatar em {
  color: var(--subtle);
  font-size: 18px;
  font-style: normal;
}

.map-slot-avatar .result-portrait {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.map-slot-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-slot-clear {
  position: absolute;
  top: 50%;
  right: 41px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--subtle);
  background: var(--surface-solid);
  cursor: pointer;
  transform: translateY(-50%);
}

.map-slot-clear:hover { border-color: var(--red); color: var(--red); }

.map-slot-open {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  background: var(--surface-solid);
  font-size: 11px;
  font-weight: 850;
}

.map-hero-picker {
  position: absolute;
  z-index: 20;
  top: 96px;
  right: 14px;
  left: 14px;
  max-height: min(560px, calc(100vh - 190px));
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(20, 38, 27, 0.16);
  overflow-y: auto;
}

.map-picker-title {
  position: sticky;
  z-index: 2;
  top: -10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -10px -10px 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.map-picker-title span { color: var(--muted); font-size: 11px; font-weight: 800; }
.map-picker-title button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--subtle);
  background: var(--surface-solid);
  cursor: pointer;
}

.map-picker-group + .map-picker-group { margin-top: 12px; }
.map-picker-group h3 {
  margin: 0 0 7px;
  color: var(--subtle);
  font-size: 10px;
}

.map-picker-group div {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}

.map-picker-hero {
  min-width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-soft);
  cursor: pointer;
}

.map-picker-hero:hover { border-color: var(--green); }
.map-picker-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.map-picker-hero span {
  display: block;
  padding: 3px 2px 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.result-mode {
  --bg: #080a09;
  --surface: #101412;
  --surface-solid: #141917;
  --surface-soft: #151a18;
  --text: #eef4ef;
  --muted: #a7b3ab;
  --subtle: #6f7d74;
  --line: #222b26;
  --line-strong: #344038;
  --green-soft: #102a20;
  --blue-soft: #132642;
  --red-soft: #351920;
  background: #080a09;
}

body.result-mode main {
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

body.result-mode #resultWorkspace.active {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  height: 100vh;
}

body.result-mode .result-toolbar {
  grid-template-columns: auto 1fr auto;
  min-height: 48px;
  padding: 7px 10px;
  border-bottom: 1px solid #202822;
  background: #0f1211;
}

body.result-mode .result-toolbar strong {
  justify-self: start;
  color: #f3f7f4;
  font-size: 13px;
  letter-spacing: 0;
}

body.result-mode .result-toolbar .secondary-button,
body.result-mode .result-toolbar .danger-button {
  height: 30px;
  border-color: #2a332e;
  color: #d7e1da;
  background: #151a18;
  box-shadow: none;
}

body.result-mode .result-toolbar .danger-button { color: #ff9aa4; }
body.result-mode .result-toolbar-actions { gap: 8px; }
body.result-mode .drawing-tools { border-color: #2a332e; background: #151a18; }
body.result-mode .draw-button { color: #aab5ad; }

body.result-mode .draw-button:hover,
body.result-mode .draw-button.active {
  border-color: #3b4840;
  color: #f3f7f4;
  background: #202722;
}

body.result-mode .draw-button.red-pen.active { border-color: var(--red); color: #ff6b7a; }
body.result-mode .draw-button.blue-pen.active { border-color: var(--blue); color: #70a8ff; }
body.result-mode .draw-button kbd { color: #8a978e; background: #0d1110; }
body.result-mode .shortcut-settings summary:hover,
body.result-mode .shortcut-settings[open] summary { background: #202722; color: #f3f7f4; }
body.result-mode .shortcut-panel {
  border-color: #303a34;
  background: #151a18;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

body.result-mode .result-stage {
  grid-template-columns: minmax(0, 1fr) clamp(170px, 18vw, 245px);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at center, rgba(48, 84, 59, 0.18), transparent 52%),
    linear-gradient(90deg, #080b0a, #0e1310 62%, #111412);
  box-shadow: none;
}

body.result-mode .result-map-shell {
  grid-column: 1;
  grid-row: 1 / 3;
  width: min(calc(100vw - clamp(170px, 18vw, 245px) - 18px), calc(100vh - 58px));
  max-width: 100%;
  aspect-ratio: 1;
  border: 1px solid #1c2520;
  border-radius: 0;
  background: #101411;
  box-shadow: 0 0 80px rgba(11, 18, 14, 0.45);
}

body.result-mode .blue-result { grid-column: 2; grid-row: 1; }
body.result-mode .red-result {
  grid-column: 2;
  grid-row: 2;
  border-top: 1px solid #202822;
}

body.result-mode .result-team {
  align-content: start;
  padding: 14px 12px;
  border-left: 1px solid #202822;
  background: rgba(17, 20, 19, 0.96);
}

body.result-mode .result-team-title { margin-bottom: 12px; }
body.result-mode .result-team-title span { font-size: 9px; }
body.result-mode .result-team-title strong { font-size: 16px; }
body.result-mode .result-rails {
  grid-template-columns: 46px 46px;
  justify-content: space-between;
  gap: 10px;
}
body.result-mode .result-bans,
body.result-mode .result-picks { gap: 5px; }
body.result-mode .result-portrait,
body.result-mode .result-empty {
  width: 46px;
}
body.result-mode .result-portrait { border-color: #303a34; background: #0d1110; }
body.result-mode .result-empty {
  position: relative;
  border-color: #2a332e;
  color: transparent;
  background: #151a18;
  font-size: 0;
}

body.result-mode .result-empty::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #334039;
}

body.result-mode .result-map-hint {
  top: 12px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(9, 13, 11, 0.66);
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 22px;
  max-width: 340px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 160ms ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .app-header { grid-template-columns: 90px auto 1fr; padding-inline: 14px; }
  .search-box { width: 130px; }
  :root { --draft-side-width: 210px; }
  .draft-progress { grid-template-columns: 1fr auto; }
  .draft-progress .progress-track { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 820px) {
  html { min-width: 620px; }
  .app-header { grid-template-columns: auto 1fr; gap: 8px; }
  .back-link { display: none; }
  .mode-switch { justify-self: start; }
  .header-tools { min-width: 0; }
  .search-box { flex: 1; width: auto; }
  .size-switch button { padding-inline: 9px; }
  main { padding-inline: 10px; }
  .workspace-tools { min-height: 48px; }
  .team-board { padding: 10px; }
  .team-heading .team-identity { gap: 6px; }
  .yuanliu-token { width: 42px; height: 42px; }
  .priority-slot { flex-basis: 26px; width: 26px; height: 26px; }
  .team-controls { display: none !important; }
  :root { --draft-side-width: 188px; --pick-size: 70px; }
  .simulator-shell { grid-template-columns: var(--draft-side-width) 6px minmax(255px, 1fr) 6px var(--draft-side-width); gap: 2px; padding-top: 10px; }
  .draft-side { padding: 8px; }
  .draft-progress { gap: 8px; }
  .bp-photo-stage {
    --photo-ban-size: 36px;
    --photo-ban-base-top: 36px;
    --photo-pick-base-top: 25px;
    grid-template-columns: minmax(190px, 1fr) 54px minmax(190px, 1fr);
    gap: 8px;
    padding: 10px;
  }
  .bp-photo-team { padding: 10px; }
  .bp-photo-title { margin-bottom: 8px; }
  .bp-photo-title strong { font-size: 15px; }
  .bp-photo-title span { font-size: 8px; letter-spacing: 0.08em; }
  .bp-photo-bans { left: 11px; gap: 4px; }
  .bp-photo-picks { grid-template-columns: repeat(5, minmax(50px, 1fr)); gap: 7px; }
  .bp-photo-bans .photo-portrait,
  .bp-photo-bans .photo-empty {
    flex-basis: var(--photo-ban-size);
    width: var(--photo-ban-size);
    height: var(--photo-ban-size);
    min-width: var(--photo-ban-size);
    max-width: var(--photo-ban-size);
  }
  .bp-photo-bans .photo-portrait.ban { width: var(--photo-ban-size); height: var(--photo-ban-size); }
  .bp-photo-bans > :nth-child(3) { margin-left: 10px; }
  .bp-photo-card strong { font-size: 9px; }
  .bp-photo-center strong { width: 44px; height: 44px; }
  .map-demo-stage { grid-template-columns: minmax(360px, 1fr) 250px; gap: 8px; padding: 10px; }
  .map-selector-panel { padding: 10px; }
  .map-panel-head { display: grid; gap: 8px; }
  .map-slot-main { grid-template-columns: 48px 40px minmax(0, 1fr) 28px; min-height: 50px; gap: 7px; }
  .map-slot-avatar { width: 40px; height: 40px; }
  .map-slot-clear { right: 36px; }
  .map-slot-open { width: 24px; height: 24px; }
  .map-hero-picker { top: 118px; right: 10px; left: 10px; max-height: min(480px, calc(100vh - 178px)); }
  .map-picker-group div { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
  .result-stage { grid-template-columns: 104px minmax(300px, 1fr) 104px; gap: 8px; padding: 10px; }
  .map-demo-stage { grid-template-columns: minmax(360px, 1fr) 250px; gap: 8px; padding: 10px; }
  .result-toolbar { grid-template-columns: auto 1fr; gap: 8px; }
  .result-toolbar strong { display: none; }
  .result-toolbar-actions { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
  .drawing-tools { overflow-x: auto; }
  .draw-button { padding-inline: 6px; }
  .result-team-title { margin-bottom: 8px; }
  .result-team-title span { display: none; }
  .result-team-title strong { font-size: 16px; }
  .result-rails { gap: 4px; }
  .result-bans, .result-picks { gap: 4px; }
  .map-hero-marker { width: 32px; height: 32px; }
}

@media (max-width: 680px) and (orientation: portrait) {
  html { min-width: 0; }

  body.simulator-mode {
    min-height: 100dvh;
    overflow: hidden;
  }

  body.simulator-mode #simulatorWorkspace {
    position: relative;
    min-height: calc(100dvh - 68px);
  }

  body.simulator-mode #simulatorWorkspace::before {
    position: fixed;
    z-index: 70;
    inset: 74px 16px auto;
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-solid);
    box-shadow: var(--shadow);
    font-size: 17px;
    font-weight: 850;
    text-align: center;
    line-height: 1.6;
    content: "请横屏使用 BP 模拟器";
  }

  body.simulator-mode #simulatorWorkspace::after {
    position: fixed;
    z-index: 70;
    inset: 198px 36px auto;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    content: "横屏后左右 BP 轨道固定，中间英雄池可滚动";
  }

  body.simulator-mode .simulator-shell {
    opacity: 0.12;
    pointer-events: none;
  }
}

@media (max-width: 1024px) and (max-height: 620px) and (orientation: landscape) {
  html { min-width: 0; }

  body.simulator-mode {
    overflow: hidden;
    background: var(--bg);
  }

  body.simulator-mode .app-header {
    grid-template-columns: 1fr auto 1fr;
    min-height: 40px;
    padding: 4px 8px;
  }

  body.simulator-mode .back-link,
  body.simulator-mode .header-tools {
    display: none;
  }

  body.simulator-mode .mode-switch {
    justify-self: center;
    padding: 2px;
  }

  body.simulator-mode .mode-button {
    min-height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }

  body.simulator-mode main {
    height: calc(100dvh - 40px);
    padding: 4px 6px 6px;
    overflow: hidden;
  }

  body.simulator-mode #simulatorWorkspace.active {
    width: 100%;
    height: 100%;
  }

  body.simulator-mode .simulator-shell {
    display: grid;
    grid-template-columns: 144px minmax(0, 1fr) 144px;
    gap: 6px;
    height: 100%;
    min-height: 0;
    padding-top: 0;
  }

  body.simulator-mode .side-resizer {
    display: none;
  }

  body.simulator-mode .draft-side,
  body.simulator-mode .draft-center {
    min-height: 0;
    border-radius: 8px;
    box-shadow: none;
  }

  body.simulator-mode .draft-side {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 5px;
    overflow: hidden;
  }

  body.simulator-mode .draft-side-title {
    display: none;
  }

  body.simulator-mode .red-draft .draft-side-title,
  body.simulator-mode .draft-side-title {
    flex-direction: row;
  }

  body.simulator-mode .draft-side-title span {
    display: none;
  }

  body.simulator-mode .draft-side-title strong {
    font-size: 12px;
  }

  body.simulator-mode .ban-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    margin-bottom: 5px;
  }

  body.simulator-mode .ban-row .draft-slot:nth-child(n) {
    grid-column: auto;
  }

  body.simulator-mode .pick-column {
    align-content: start;
    gap: 3px;
    justify-items: center;
    overflow: hidden;
  }

  body.simulator-mode .draft-slot {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
  }

  body.simulator-mode .draft-side .draft-slot img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover !important;
  }

  body.simulator-mode .ban-row .draft-slot {
    width: 100%;
    aspect-ratio: 1;
    min-height: 0;
  }

  body.simulator-mode .pick-column .draft-slot {
    width: min(100%, 34px);
    height: 34px;
    min-height: 0;
  }

  body.simulator-mode .draft-slot .slot-empty {
    font-size: 0;
  }

  body.simulator-mode .draft-slot .slot-empty::after {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--subtle);
    opacity: 0.55;
    content: "";
  }

  body.simulator-mode .draft-center {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 6px;
    overflow: hidden;
  }

  body.simulator-mode .draft-progress {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 0 0 5px;
  }

  body.simulator-mode .progress-copy {
    display: grid;
    gap: 1px;
  }

  body.simulator-mode .draft-progress span,
  body.simulator-mode .draft-progress strong {
    font-size: 10px;
  }

  body.simulator-mode .progress-track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 3px;
  }

  body.simulator-mode .simulator-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    gap: 4px;
  }

  body.simulator-mode .simulator-actions .icon-text-button,
  body.simulator-mode .simulator-actions .secondary-button,
  body.simulator-mode .simulator-actions .primary-button {
    min-height: 27px;
    padding: 0 7px;
    border-radius: 6px;
    font-size: 10px;
    white-space: nowrap;
  }

  body.simulator-mode .lane-filters {
    gap: 4px;
    padding: 5px 0 6px;
    overflow-x: auto;
    border-top: 1px solid var(--line);
  }

  body.simulator-mode .lane-filter {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 10px;
  }

  body.simulator-mode .draft-pool {
    grid-template-columns: repeat(auto-fill, 42px);
    grid-auto-rows: 42px;
    justify-content: start;
    align-content: start;
    gap: 8px;
    height: 100%;
    max-height: none;
    padding: 2px 3px 10px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.simulator-mode .draft-pool .hero-tile {
    width: 42px;
    height: 42px;
    aspect-ratio: auto;
    border-radius: 7px;
  }

  body.simulator-mode .draft-pool .hero-tile mark {
    display: none;
  }

  body.simulator-mode .toast {
    right: 10px;
    bottom: 10px;
    max-width: 260px;
    padding: 8px 10px;
    font-size: 11px;
  }
}

@media (max-width: 820px) {
  body.result-mode main {
    overflow: auto;
  }

  body.result-mode #resultWorkspace.active {
    height: auto;
    min-height: 100vh;
  }

  body.result-mode .result-toolbar {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  body.result-mode .result-toolbar strong {
    display: block;
    justify-self: end;
    padding-top: 7px;
    font-size: 12px;
  }

  body.result-mode .result-toolbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  body.result-mode .result-stage {
    grid-template-columns: minmax(360px, 1fr) 150px;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    min-height: calc(100vh - 48px);
    gap: 0;
    padding: 0;
  }

  body.result-mode .result-map-shell {
    width: min(calc(100vw - 170px), calc(100vh - 58px));
  }

  body.result-mode .result-team {
    padding: 10px 8px;
  }

  body.result-mode .result-team-title strong {
    font-size: 14px;
  }

  body.result-mode .result-rails {
    grid-template-columns: 42px 42px;
    gap: 5px;
  }

  body.result-mode .result-portrait,
  body.result-mode .result-empty {
    width: 42px;
  }
}
