* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: #0e1115;
  color: #e6e8eb;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h2,
h3,
h4 {
  margin: 0 0 8px;
  font-weight: 650;
}

h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b95a3;
}

h4 {
  font-size: 13px;
}

p {
  margin: 6px 0;
}

.muted {
  color: #8b95a3;
}

.small {
  font-size: 12px;
}

.tiny {
  font-size: 11px;
}

.num {
  font-variant-numeric: tabular-nums;
}

.ok {
  color: #3fb950;
}

.warn {
  color: #f0883e;
}

.shell {
  min-height: 100vh;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid #2a313c;
  background: #232933;
  color: #e6e8eb;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: #2d3542;
  border-color: #3f4a5a;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: #f5b83d;
  border-color: #f5b83d;
  color: #1a1404;
}
.btn--primary:hover:not(:disabled) {
  background: #ffcf6b;
  border-color: #ffcf6b;
}

.btn--ghost {
  background: transparent;
}

.btn--danger {
  color: #ffb4b4;
  border-color: rgba(229, 72, 77, 0.5);
}
.btn--danger:hover:not(:disabled) {
  background: rgba(229, 72, 77, 0.18);
}

.btn--link {
  background: none;
  border: none;
  color: #f5b83d;
  padding: 2px 4px;
}
.btn--link:hover:not(:disabled) {
  background: none;
  text-decoration: underline;
}

.btn--small {
  padding: 4px 9px;
  font-size: 12px;
}

.btn--tiny {
  padding: 1px 7px;
  font-size: 12px;
  min-width: 24px;
}

.btn--big {
  padding: 11px 28px;
  font-size: 15px;
}

.btn--wide {
  width: 100%;
  margin-top: 8px;
}

.btn--on {
  background: rgba(245, 184, 61, 0.2);
  border-color: #f5b83d;
  color: #ffcf6b;
}

.btn--p0 {
  border-color: rgba(229, 72, 77, 0.6);
  color: #f0989b;
}

.btn--p1 {
  border-color: rgba(62, 142, 240, 0.6);
  color: #93c0f7;
}

.input {
  font: inherit;
  background: #161a20;
  color: #e6e8eb;
  border: 1px solid #2a313c;
  border-radius: 6px;
  padding: 7px 10px;
}
.input:focus {
  outline: none;
  border-color: #f5b83d;
}
.input:disabled {
  opacity: 0.6;
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, #8b95a3 50%), linear-gradient(135deg, #8b95a3 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.input--small {
  padding: 3px 6px;
  font-size: 12px;
}

.input--code {
  letter-spacing: 0.25em;
  font-weight: 700;
  text-transform: uppercase;
  flex: 1;
  min-width: 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.card {
  background: #161a20;
  border: 1px solid #2a313c;
  border-radius: 8px;
  padding: 14px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: #232933;
  color: #8b95a3;
  border: 1px solid #2a313c;
  margin-right: 4px;
}

.tag--ok {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.5);
}

.tag--rule {
  color: #ffcf6b;
}

.tag--tiny {
  font-size: 10px;
  padding: 0 5px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.chip {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #2a313c;
  background: #1c2129;
  color: #e6e8eb;
  cursor: pointer;
}
.chip:hover {
  border-color: #f5b83d;
}

.chip--on {
  background: rgba(245, 184, 61, 0.18);
  border-color: #f5b83d;
  color: #ffcf6b;
}

.chip--p0 {
  border-left: 3px solid #e5484d;
}

.chip--p1 {
  border-left: 3px solid #3e8ef0;
}

.choice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: rgba(22, 26, 32, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #2a313c;
}

.topbar__brand {
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #f5b83d;
  white-space: nowrap;
}

.topbar__home {
  padding: 0;
  background: none;
  border: none;
  border-radius: 3px;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.15s, text-shadow 0.15s;
}
.topbar__home:hover {
  color: #ffcf6b;
  text-shadow: 0 0 8px rgba(245, 184, 61, 0.35);
}
.topbar__home:focus-visible {
  outline: 2px solid #ffcf6b;
  outline-offset: 3px;
}

.topbar__version {
  margin-left: 8px;
  padding: 0;
  background: none;
  border: none;
  color: #8b95a3;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.topbar__version:hover {
  color: #ffcf6b;
}

.topbar__info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.topbar__scenario {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__turn {
  color: #8b95a3;
  white-space: nowrap;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.phase-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 184, 61, 0.15);
  color: #ffcf6b;
  border: 1px solid rgba(245, 184, 61, 0.4);
  white-space: nowrap;
}

.turn-who {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #2a313c;
  white-space: nowrap;
}

.turn-who--p0 {
  color: #ef8b8e;
  border-color: rgba(229, 72, 77, 0.5);
}

.turn-who--p1 {
  color: #85b8f6;
  border-color: rgba(62, 142, 240, 0.5);
}

.turn-who--mine {
  box-shadow: 0 0 0 2px rgba(245, 184, 61, 0.35);
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8b95a3;
  padding: 3px 10px;
  border: 1px solid #2a313c;
  border-radius: 999px;
}

.conn__room {
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #e6e8eb;
}

.conn__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #232933;
  border: 2px solid #2a313c;
}

.conn__dot--on.conn__dot--p0 {
  background: #e5484d;
  border-color: #e5484d;
}

.conn__dot--on.conn__dot--p1 {
  background: #3e8ef0;
  border-color: #3e8ef0;
}

.conn__dot--me {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(ellipse at top, rgba(245, 184, 61, 0.08), transparent 55%), #0e1115;
}

.home__hero {
  text-align: center;
  margin-bottom: 28px;
}

.home__logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.home__logo-mark {
  color: #f5b83d;
}

.home__tag {
  color: #8b95a3;
  font-size: 15px;
}

.home__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 300px));
  gap: 16px;
}

.home__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home__card h2 {
  font-size: 18px;
}

.home__join {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.home__footer {
  margin-top: 20px;
  max-width: 696px;
  text-align: center;
}

.home__version {
  margin: 8px 0 0;
  color: #8b95a3;
  font-size: 12px;
}
.home__version .btn--link {
  margin-left: 6px;
  font-size: 12px;
}

.fan-badge {
  display: inline-block;
  margin: 6px 0 2px;
  padding: 2px 8px;
  border: 1px solid #2a313c;
  border-radius: 999px;
  color: #8b95a3;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.topbar__brand .fan-badge {
  margin: 0 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.disclaimer {
  margin: 14px 0 0;
  color: #8b95a3;
  font-size: 11px;
  line-height: 1.5;
}
.disclaimer a {
  color: inherit;
}

.setup {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.banner {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(62, 142, 240, 0.12);
  border: 1px solid rgba(62, 142, 240, 0.4);
}

.banner--warn {
  background: rgba(240, 136, 62, 0.12);
  border-color: rgba(240, 136, 62, 0.45);
}

.setup__body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.setup__body--forces {
  grid-template-columns: minmax(340px, 1fr) minmax(0, 1.6fr);
}

.setup__left,
.setup__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.setup__editor-link {
  align-self: flex-start;
}

.steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.steps__step {
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  color: #8b95a3;
  cursor: pointer;
  white-space: nowrap;
}
.steps__step:hover:not(:disabled) {
  color: #e6e8eb;
}
.steps__step:disabled {
  cursor: default;
  opacity: 0.45;
}

.steps__step--off {
  opacity: 0.45;
}

.picker--locked .scenarios {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.steps__step--on {
  color: #ffcf6b;
  border-color: rgba(245, 184, 61, 0.5);
  background: rgba(245, 184, 61, 0.1);
}

.steps__sep {
  color: #8b95a3;
}

.battlefield__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.battlefield__name {
  margin: 0;
  font-size: 20px;
}

.battlefield__map {
  display: block;
  width: 100%;
  height: auto;
  max-height: 58vh;
  border-radius: 6px;
  background: #1c241b;
}

.battlefield__info {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 12px;
}
.battlefield__info p {
  margin: 0 0 6px;
}

.roster-lines {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roster-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  background: #1c2129;
  border: 1px solid #2a313c;
  border-radius: 6px;
}

.roster-line__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.roster-line__name {
  font-weight: 600;
}

.setup__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(22, 26, 32, 0.96);
  border-top: 1px solid #2a313c;
}
.setup__footer .btn--big {
  margin-left: auto;
}

.ready {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scenarios {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scenario {
  font: inherit;
  text-align: left;
  color: #e6e8eb;
  background: #1c2129;
  border: 1px solid #2a313c;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.scenario:hover:not(:disabled) {
  border-color: #434e60;
}
.scenario:disabled {
  cursor: default;
}

.scenario--on {
  border-color: #f5b83d;
  box-shadow: inset 3px 0 0 #f5b83d;
  background: rgba(245, 184, 61, 0.06);
}

.scenario__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.scenario__name {
  font-weight: 700;
}

.scenario__goal {
  color: #ffcf6b;
  margin-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 10px 0;
}
.field > span {
  font-size: 12px;
  color: #8b95a3;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: flex;
  border: 1px solid #2a313c;
  border-radius: 6px;
  overflow: hidden;
}
.segmented button {
  flex: 1;
  font: inherit;
  font-size: 12px;
  padding: 7px 8px;
  background: #1c2129;
  color: #8b95a3;
  border: none;
  cursor: pointer;
}
.segmented button + button {
  border-left: 1px solid #2a313c;
}
.segmented button.on {
  background: rgba(245, 184, 61, 0.16);
  color: #ffcf6b;
  font-weight: 600;
}
.segmented button:disabled {
  cursor: default;
}

.forces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.force {
  border-top: 3px solid #8b95a3;
}

.force--p0 {
  border-top-color: #e5484d;
}

.force--p1 {
  border-top-color: #3e8ef0;
}

.force__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.force__head h3 {
  margin: 0;
  color: #e6e8eb;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
}

.force__totals {
  color: #ffcf6b;
  font-size: 12px;
  margin: 4px 0 8px;
  font-variant-numeric: tabular-nums;
}

.picks {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pick {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #1c2129;
  border: 1px solid #2a313c;
  border-radius: 6px;
  padding: 6px 8px;
}

.pick__body {
  flex: 1;
  min-width: 0;
}

.thumb {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #e9ecef;
  border: 1px solid #2a313c;
  overflow: hidden;
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pv-limit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: #161a20;
  border: 1px solid #2a313c;
  border-radius: 8px;
}

.pv-limit__label {
  font-weight: 600;
}

.pv-limit__input {
  width: 90px;
}

.pv-limit__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #161a20;
  border: 1px solid #2a313c;
  border-radius: 8px;
}
.options p {
  margin: 0;
}

.options__label {
  font-weight: 600;
}

.options__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.options__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pick__nick {
  width: 9em;
}

.secret {
  margin: 8px 0;
  padding: 14px 12px;
  text-align: center;
  color: #8b95a3;
  border: 1px dashed #2a313c;
  border-radius: 6px;
}

.player-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pick__info {
  display: flex;
  flex-direction: column;
}

.pick__top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.role-tag {
  margin-left: auto;
  align-self: center;
  flex: none;
  white-space: nowrap;
}

.pick__name {
  font-weight: 600;
}

.pick__controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.lances {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lance {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 8px;
  border: 1px dashed #2a313c;
  border-radius: 6px;
}

.lance__name {
  font-weight: 600;
  font-size: 12px;
}

.catalog {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filters .input:first-child {
  flex: 1 1 200px;
}

.cat-list {
  max-height: 460px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
}
.cat-row:nth-child(odd) {
  background: #1c2129;
}
.cat-row:hover {
  background: #232933;
}

.cat-row__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cat-row__name {
  font-weight: 600;
}

.cat-row__add {
  display: flex;
  gap: 6px;
}

.battle {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.battle__main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "board side" "board actions";
}

.battle__board {
  grid-area: board;
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 10px;
}

.battle__side {
  grid-area: side;
  min-height: 0;
  padding: 10px 12px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.battle__actions {
  grid-area: actions;
  max-height: 55vh;
  overflow-y: auto;
  padding: 0 12px 10px 0;
  background: #0e1115;
}
.battle__actions > .panel {
  border-color: rgba(245, 184, 61, 0.45);
}

.waiting {
  padding: 2px 0 2px 10px;
  border-left: 3px solid #2a313c;
}

.waiting__what {
  margin: 0 0 4px;
  font-weight: 600;
}

.battle__side-toggle {
  display: none;
}

.dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dock--top,
.dock--bottom {
  max-height: 60%;
  overflow-y: auto;
}

.dock--scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.dock--edit {
  min-height: 34px;
  padding: 6px;
  border: 1px dashed #2a313c;
  border-radius: 8px;
}

.dock__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b95a3;
}

.frame__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.frame__title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b95a3;
  text-align: left;
  cursor: pointer;
}
.frame__title:hover {
  color: #e6e8eb;
}

.frame__chevron {
  width: 10px;
}

.frame__tools {
  display: flex;
  gap: 4px;
}

.frame__body--hidden {
  display: none;
}

.frame--viewer .frame__body {
  min-height: 230px;
}

.layout-controls__hidden {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.board-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #11160f;
  border: 1px solid #2a313c;
}

.board {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

.board--panning {
  cursor: grabbing;
}

.zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zoom__btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #2a313c;
  background: rgba(22, 26, 32, 0.9);
  color: #e6e8eb;
  font-size: 16px;
  cursor: pointer;
}
.zoom__btn:hover {
  border-color: #f5b83d;
}

.editor {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.editor .topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.editor .topbar__right {
  margin-left: auto;
}

.editor__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 12px;
  padding: 12px;
}

.editor__side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
}

.editor__main {
  min-width: 0;
  min-height: 0;
}

.editor__wide {
  width: 100%;
}

.editor__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.editor__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}
.editor__row .field {
  margin: 6px 0;
  min-width: 0;
}
.editor__row .input {
  width: 100%;
}

.editor__snap {
  margin-bottom: 14px;
  font-size: 12px;
}

.editor__file {
  display: none;
}

.editor__title {
  font-weight: 650;
  color: #8b95a3;
}

.editor__tabs {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 12px 0;
  border-bottom: 1px solid #2a313c;
}

.editor__tab {
  font: inherit;
  font-weight: 650;
  padding: 8px 22px;
  color: #8b95a3;
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
  cursor: pointer;
}
.editor__tab:hover {
  color: #e6e8eb;
}

.editor__tab--on {
  color: #ffcf6b;
  background: #161a20;
  border-color: #2a313c;
  border-bottom: 1px solid #161a20;
}

.editor__tab-hint {
  margin: 0 0 9px 12px;
}

.editor__body--full {
  grid-template-columns: 1fr;
  overflow-y: auto;
}

.editor-start {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.editor-start h2 {
  margin-top: 0;
}

.start-rows,
.start-copies {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.start-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #1c2129;
  border: 1px solid #2a313c;
  border-radius: 6px;
}

.start-row__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.start-row__name {
  font-weight: 650;
}

.start-copy {
  font: inherit;
  text-align: left;
  color: #e6e8eb;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: #1c2129;
  border: 1px solid #2a313c;
  border-radius: 6px;
  cursor: pointer;
}
.start-copy:hover {
  border-color: #f5b83d;
}

.save {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor__setup {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  overflow-y: auto;
}

.editor__setup-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.editor__check {
  display: flex;
  align-items: flex-start;
  margin: 8px 0;
  font-size: 13px;
}
.editor__check input {
  margin-top: 3px;
}

.scenarios__group {
  margin: 16px 0 4px;
}

.editor__effects {
  margin: 6px 0;
  padding-left: 18px;
  color: #8b95a3;
}

.map-import {
  align-self: flex-start;
  margin-bottom: 6px;
}

.pieces {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 280px;
  overflow-y: auto;
}

.piece {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 4px;
}
.piece:hover {
  background: #1c2129;
}

.piece--on {
  border-color: #f5b83d;
  background: rgba(245, 184, 61, 0.08);
}

.piece__name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: #e6e8eb;
  background: none;
  border: none;
  padding: 3px 2px;
  cursor: pointer;
}
.piece__name > span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.swatch--woods {
  background: #2e6c34;
}

.swatch--water {
  background: #2860a0;
}

.swatch--hill {
  background: #8c7448;
}

.swatch--building {
  background: #565e6c;
}

.swatch--rough {
  background: #7a684e;
}

.swatch--clear {
  background: #27321f;
}

.map-editor {
  cursor: crosshair;
}

.map-editor--select {
  cursor: default;
}
.map-editor--select .t__base {
  pointer-events: visiblePainted;
  cursor: move;
}

.ed-piece--on .t__base {
  stroke: #f5b83d;
}

.ed-outline {
  fill: none;
  stroke: #f5b83d;
  stroke-width: 0.12;
  stroke-dasharray: 0.5 0.3;
  pointer-events: none;
}

.ed-vertex {
  fill: #f5b83d;
  stroke: #1a1404;
  stroke-width: 0.08;
  cursor: grab;
}

.ed-mid {
  fill: rgba(255, 255, 255, 0.6);
  stroke: #1a1404;
  stroke-width: 0.06;
  cursor: copy;
}

.ed-draft {
  fill: none;
  stroke: #f5b83d;
  stroke-width: 0.12;
  pointer-events: none;
}

.ed-draft-corner {
  fill: #f5b83d;
  pointer-events: none;
}

.ed-close {
  fill: none;
  stroke: #f5b83d;
  stroke-width: 0.1;
  pointer-events: none;
}

.ed-close--on {
  fill: rgba(245, 184, 61, 0.4);
}

.ed-mech {
  fill: rgba(229, 72, 77, 0.55);
  stroke: #fff;
  stroke-width: 0.08;
  pointer-events: none;
}

.ed-mech--target {
  fill: rgba(62, 142, 240, 0.55);
}

.ed-mech--ghost {
  fill: rgba(255, 255, 255, 0.15);
  stroke-dasharray: 0.25 0.2;
}

.ed-stop {
  fill: none;
  stroke: #e5484d;
  stroke-width: 0.14;
  pointer-events: none;
}

.readout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  margin: 4px 0 8px;
  font-size: 13px;
}
.readout dt {
  color: #8b95a3;
}
.readout dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.ed-measure {
  font-size: 0.75px;
  font-weight: 700;
  text-anchor: middle;
  fill: #ffcf6b;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.7);
  stroke-width: 0.12px;
  pointer-events: none;
}

.board__ground {
  fill: #27321f;
}

.grid-fine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.045);
  stroke-width: 0.03;
}

.grid-major {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 0.06;
}

.board__grid {
  pointer-events: none;
}

.t {
  pointer-events: none;
}

.t__base {
  stroke-width: 0.1;
  stroke-linejoin: round;
}

.t__under {
  fill: #27321f;
}

.terrain-tip {
  position: absolute;
  z-index: 5;
  max-width: 280px;
  padding: 8px 10px;
  background: rgba(22, 26, 32, 0.96);
  border: 1px solid #2a313c;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  pointer-events: none;
}

.terrain-tip__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.terrain-tip__effects {
  margin: 0;
  padding-left: 16px;
  color: #c4cad2;
}
.terrain-tip__effects li + li {
  margin-top: 3px;
}

.terrain-tip__covers {
  margin-top: 6px;
  color: #8b95a3;
  font-style: italic;
}

.t__label {
  font-size: 0.8px;
  font-weight: 700;
  text-anchor: middle;
  fill: rgba(255, 255, 255, 0.78);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 0.12px;
}

.t__badge {
  font-size: 0.7px;
  font-weight: 700;
  text-anchor: middle;
  fill: rgba(255, 255, 255, 0.85);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 0.12px;
}

.t--woods .t__base {
  fill: rgba(46, 108, 52, 0.78);
  stroke: #5fa266;
}

.pat-woods {
  fill: rgba(16, 52, 20, 0.6);
}

.t--rough .t__base {
  fill: rgba(122, 104, 78, 0.7);
  stroke: #a38f6c;
  stroke-dasharray: 0.4 0.25;
}

.pat-rough {
  fill: rgba(40, 32, 22, 0.55);
}

.t--water .t__base {
  fill: rgba(40, 96, 160, 0.78);
  stroke: #6aa8e6;
}

.pat-water {
  fill: none;
  stroke: rgba(160, 210, 255, 0.35);
  stroke-width: 0.06;
}

.t--hill .t__base {
  fill: rgba(140, 116, 72, 0.6);
  stroke: #c9a76b;
  stroke-width: 0.14;
}

.t--building .t__base {
  fill: rgba(86, 94, 108, 0.95);
  stroke: #b4bcc8;
}

.pat-building {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 0.12;
}

.t--open .t__base {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(255, 255, 255, 0.2);
}

.ghost {
  opacity: 0.55;
  stroke: #f5b83d;
  stroke-width: 0.12;
  stroke-dasharray: 0.4 0.3;
  pointer-events: none;
}
.ghost.t--woods {
  fill: rgba(46, 108, 52, 0.7);
}
.ghost.t--water {
  fill: rgba(40, 96, 160, 0.7);
}
.ghost.t--hill {
  fill: rgba(140, 116, 72, 0.7);
}
.ghost.t--building {
  fill: rgba(86, 94, 108, 0.9);
}
.ghost.t--rough {
  fill: rgba(122, 104, 78, 0.7);
}

.zone {
  fill: var(--c);
  fill-opacity: 0.07;
  stroke: var(--c);
  stroke-width: 0.1;
  stroke-dasharray: 0.5 0.35;
  pointer-events: none;
}

.zone--active {
  fill-opacity: 0.17;
  stroke-width: 0.16;
}

.zone--choice {
  fill: #fff;
  fill-opacity: 0.035;
  stroke: rgba(255, 255, 255, 0.35);
}

.home-edge {
  opacity: 0.85;
  pointer-events: none;
}

.path {
  fill: none;
  stroke: var(--c);
  stroke-width: 0.16;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
  pointer-events: none;
}

.path--jump {
  stroke-dasharray: 0.5 0.35;
}

.path__start {
  fill: var(--c);
  fill-opacity: 0.12;
  stroke: var(--c);
  stroke-width: 0.08;
  stroke-dasharray: 0.25 0.2;
  opacity: 0.8;
  pointer-events: none;
}

.reach {
  fill: rgba(245, 184, 61, 0.045);
  stroke: rgba(245, 184, 61, 0.7);
  stroke-width: 0.08;
  stroke-dasharray: 0.35 0.3;
  pointer-events: none;
}

.leg {
  stroke: #f5b83d;
  stroke-width: 0.12;
  stroke-dasharray: 0.3 0.2;
  pointer-events: none;
}

.leg__end {
  fill: rgba(245, 184, 61, 0.12);
  stroke: #f5b83d;
  stroke-width: 0.08;
  pointer-events: none;
}

.leg__label,
.los__label,
.ring__label {
  font-size: 0.75px;
  font-weight: 700;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 0.18px;
  pointer-events: none;
}

.leg__label {
  fill: #ffcf6b;
}

.arc {
  fill: rgba(255, 255, 255, 0.035);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 0.06;
  pointer-events: none;
}

.ring {
  fill: none;
  stroke-width: 0.07;
  stroke-dasharray: 0.45 0.35;
  pointer-events: none;
}

.ring--S {
  stroke: rgba(63, 185, 80, 0.8);
}

.ring--M {
  stroke: rgba(245, 184, 61, 0.75);
}

.ring--L {
  stroke: rgba(240, 136, 62, 0.7);
}

.ring__label {
  fill: rgba(255, 255, 255, 0.8);
}

.los {
  stroke-width: 0.14;
  stroke-linecap: round;
  pointer-events: none;
}

.los--clear {
  stroke: #3fb950;
}

.los--cover {
  stroke: #f5b83d;
}

.los--blocked {
  stroke: #e5484d;
  stroke-dasharray: 0.35 0.25;
}

.los__label {
  fill: #fff;
}

.unit {
  cursor: pointer;
}

.unit__halo {
  fill: none;
  stroke: transparent;
  stroke-width: 0.14;
}

.unit--active .unit__halo {
  stroke: #f5b83d;
  animation: halo 1.6s ease-in-out infinite;
}

.unit--targetable .unit__halo {
  stroke: rgba(255, 107, 91, 0.55);
}

.unit--hover .unit__halo {
  stroke: rgba(255, 255, 255, 0.55);
}

.unit--selected .unit__halo {
  stroke: #fff;
  stroke-width: 0.16;
  animation: none;
}

.unit--targeted .unit__halo {
  stroke: #ff6b5b;
  stroke-width: 0.22;
  animation: none;
}

@keyframes halo {
  0%, 100% {
    stroke-opacity: 1;
  }
  50% {
    stroke-opacity: 0.35;
  }
}
.unit__base {
  fill: #12161b;
  stroke: var(--c);
  stroke-width: 0.16;
}

.unit__img {
  pointer-events: none;
}

.unit__nose {
  fill: var(--c);
  pointer-events: none;
}

.unit__factory {
  fill: #59606b;
  stroke: #c3c9d2;
  stroke-width: 0.12;
}

.unit__label {
  font-size: 0.68px;
  font-weight: 800;
  text-anchor: middle;
  fill: #f2f4f6;
  paint-order: stroke;
  stroke: #0b0e11;
  stroke-width: 0.17px;
  pointer-events: none;
}

.unit__bar-bg {
  fill: rgba(0, 0, 0, 0.7);
}

.unit__bar--armor {
  fill: #5ec8f2;
}

.unit__bar--structure {
  fill: #f0a35e;
}

.unit__heat {
  stroke: #0b0e11;
  stroke-width: 0.06;
}

.unit__heat--1 {
  fill: #f0c23d;
}

.unit__heat--2 {
  fill: #f0883e;
}

.unit__heat--3 {
  fill: #e5484d;
}

.unit__heat--4 {
  fill: #9b1c24;
}

.unit__heat-text {
  font-size: 0.5px;
  font-weight: 800;
  text-anchor: middle;
  fill: #111;
  pointer-events: none;
}

.unit__status {
  font-size: 0.45px;
  font-weight: 900;
  text-anchor: middle;
  fill: #ff8a80;
  pointer-events: none;
}

.unit__x {
  stroke: #ff4d4d;
  stroke-width: 0.16;
  pointer-events: none;
}

.unit--doomed .unit__base {
  stroke-dasharray: 0.25 0.15;
}

.unit--offboard {
  opacity: 0.55;
}
.unit--offboard .unit__base {
  stroke-dasharray: 0.3 0.2;
}

.unit__handle-line {
  stroke: rgba(245, 184, 61, 0.6);
  stroke-width: 0.06;
  pointer-events: none;
}

.unit__handle {
  fill: #f5b83d;
  stroke: #0b0e11;
  stroke-width: 0.07;
  cursor: grab;
}

.unit__handle-hit {
  fill: transparent;
  pointer-events: none;
}

.wreck path {
  stroke: #6b7280;
  stroke-width: 0.18;
  stroke-linecap: round;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.summary {
  background: #1c2129;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.summary ul {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 12px;
}

.spa {
  margin: 8px 0;
}

.edge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mover {
  background: #1c2129;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 6px 0;
}

.mover__name {
  font-weight: 700;
}

.mover__budget {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.meter {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #161a20;
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  background: #f5b83d;
}

.toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.lucky {
  border: 1px solid rgba(245, 184, 61, 0.5);
  background: rgba(245, 184, 61, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
}

.targets {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}

.target-row {
  font: inherit;
  color: #e6e8eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: #1c2129;
  border: 1px solid #2a313c;
  border-radius: 6px;
  padding: 6px 9px;
  cursor: pointer;
}
.target-row:hover {
  border-color: #ff6b5b;
}

.target-row--off {
  opacity: 0.6;
}

.target-row__name {
  font-weight: 600;
}

.tn {
  font-weight: 800;
  color: #ffcf6b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.planner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.planner__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.planner__sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b95a3;
  margin-top: 4px;
}

.opt {
  background: #1c2129;
  border: 1px solid #2a313c;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.opt--off {
  opacity: 0.7;
  flex-direction: row;
  justify-content: space-between;
  gap: 10px;
}

.opt__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.breakdown td {
  padding: 1px 0;
  color: #8b95a3;
}
.breakdown td.num {
  text-align: right;
  color: #e6e8eb;
}

.overheat {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.unit-card {
  border-top: 3px solid #8b95a3;
}

.unit-card--p0 {
  border-top-color: #e5484d;
}

.unit-card--p1 {
  border-top-color: #3e8ef0;
}

.unit-card__head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.unit-card__img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #232933;
  flex: 0 0 auto;
}

.unit-card__name {
  font-weight: 800;
  font-size: 15px;
}

.unit-card__status {
  font-size: 12px;
  font-weight: 700;
  color: #f0883e;
  margin-bottom: 6px;
}

.unit-card__specials {
  margin-top: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 6px 12px;
  margin-bottom: 8px;
}
.stats div {
  display: flex;
  flex-direction: column;
}
.stats span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b95a3;
}
.stats b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.track {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 12px;
}
.track > span:first-child {
  width: 62px;
  color: #8b95a3;
}

.pips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
}

.pip {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.pip--armor {
  background: #5ec8f2;
}

.pip--structure {
  background: #f0a35e;
}

.pip--off {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
}

.heat {
  display: inline-flex;
  gap: 2px;
}

.heat__box {
  width: 20px;
  height: 18px;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a313c;
  border-radius: 3px;
  color: #8b95a3;
}

.heat__box--on {
  background: #f0883e;
  border-color: #f0883e;
  color: #1a0d03;
}

.roster {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roster__title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.roster__side--p0 .roster__title {
  color: #ef8b8e;
}

.roster__side--p1 .roster__title {
  color: #85b8f6;
}

.roster__row {
  font: inherit;
  color: #e6e8eb;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}
.roster__row:hover {
  background: #1c2129;
}

.roster__row--sel {
  border-color: #f5b83d;
}

.roster__row--dead {
  opacity: 0.45;
}

.roster__name {
  width: 92px;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster__bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.minibar {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.minibar__fill {
  display: block;
  height: 100%;
}

.minibar__fill--armor {
  background: #5ec8f2;
}

.minibar__fill--structure {
  background: #f0a35e;
}

.roster__tags {
  min-width: 60px;
  text-align: right;
}

.log__body {
  max-height: 260px;
  overflow-y: auto;
  font-size: 12px;
}

.log__line {
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #c4cad2;
}

.toast {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 300px;
  max-width: min(520px, 90%);
  background: rgba(22, 26, 32, 0.97);
  border: 1px solid #2a313c;
  border-left: 4px solid #8b95a3;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  animation: toast-in 0.18s ease-out;
}

.toast--p0 {
  border-left-color: #e5484d;
}

.toast--p1 {
  border-left-color: #3e8ef0;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}
.toast__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.toast__roll {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}

.die {
  min-width: 30px;
  padding: 0 6px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #f4f1e8;
  color: #111;
  font-weight: 900;
  font-size: 15px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.toast__vs {
  color: #8b95a3;
}

.toast__verdict {
  margin-left: auto;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #8b95a3;
}

.toast--hit .toast__verdict {
  color: #3fb950;
}

.toast__crit {
  font-size: 12px;
  color: #f0883e;
}

.toast__destroyed {
  margin-top: 4px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #e5484d;
}

.gameover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 10, 0.55);
  backdrop-filter: blur(2px);
}

.gameover__card {
  text-align: center;
  min-width: 320px;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.gameover__card h2 {
  font-size: 28px;
  color: #f5b83d;
}
.gameover__card .choice {
  justify-content: center;
}

.notices {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.notice {
  background: #232933;
  border: 1px solid #2a313c;
  border-radius: 6px;
  padding: 8px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  max-width: 520px;
}

.notice--error {
  border-color: rgba(229, 72, 77, 0.6);
  background: #2a1517;
  color: #ffd0d0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal__body {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.modal__body--wide {
  max-width: 900px;
}

.modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: #8b95a3;
  font-size: 24px;
  cursor: pointer;
}

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.rules h3 {
  margin-top: 6px;
}
.rules ol,
.rules ul {
  margin: 0;
  padding-left: 18px;
}
.rules li {
  margin: 3px 0;
}

.changelog {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.changelog ul {
  margin: 0;
  padding-left: 18px;
}
.changelog li {
  margin: 4px 0;
  line-height: 1.45;
}
.changelog b {
  color: #ffcf6b;
}
.changelog code {
  padding: 0 4px;
  border-radius: 4px;
  background: #232933;
  font-size: 12px;
}

.changelog__release {
  padding-top: 14px;
  border-top: 1px solid #2a313c;
}
.changelog__release:first-child {
  padding-top: 0;
  border-top: none;
}
.changelog__release h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 6px;
}

.changelog__version {
  color: #f5b83d;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.changelog__date {
  color: #8b95a3;
  font-size: 12px;
  font-weight: 400;
}

.changelog__kind {
  margin: 10px 0 4px;
  color: #8b95a3;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ref {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ref td {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ref td + td {
  text-align: right;
  font-weight: 700;
  color: #ffcf6b;
}

@media (max-width: 1100px) {
  .battle {
    height: auto;
    min-height: 100vh;
  }
  .battle__main {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas: none;
  }
  .battle__board,
  .battle__side,
  .battle__actions {
    grid-area: auto;
  }
  .battle__board {
    height: 62vh;
  }
  .battle__side {
    padding: 0 10px 24px;
  }
  .battle__actions {
    position: sticky;
    bottom: 0;
    max-height: 40vh;
    padding: 8px 10px;
    border-top: 1px solid #2a313c;
  }
  .dock--top,
  .dock--bottom,
  .dock--scroll {
    max-height: none;
    overflow-y: visible;
  }
  .setup__body,
  .setup__body--forces,
  .battlefield__info,
  .editor__setup,
  .editor-start {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .home__grid,
  .forces {
    grid-template-columns: 1fr;
  }
  .home__logo {
    font-size: 26px;
  }
  .topbar__scenario,
  .topbar__turn {
    display: none;
  }
  .topbar {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 6px 10px;
  }
  .steps {
    flex-wrap: wrap;
    gap: 2px 4px;
  }
  .steps__step {
    padding: 4px 7px;
    font-size: 12px;
  }
  .topbar__brand {
    font-size: 12px;
    letter-spacing: 0.08em;
  }
  .topbar__brand .fan-badge {
    margin: 0 0 0 4px;
    padding: 1px 6px;
    font-size: 9px;
  }
  .topbar__version {
    margin-left: 4px;
  }
  .topbar .btn--small {
    padding: 4px 8px;
  }
  .topbar__info {
    order: 3;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  .topbar__right {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .confirm {
    flex-wrap: wrap;
  }
  .btn--link {
    white-space: normal;
    text-align: left;
  }
  .setup__body {
    gap: 12px;
    padding: 10px;
  }
  .banner {
    margin: 10px 10px 0;
  }
  .setup__footer {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px;
  }
  .setup__footer .btn--big {
    flex: 1 1 100%;
  }
  .ready {
    flex-wrap: wrap;
  }
  .cat-list {
    max-height: 60vh;
  }
  .battle {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }
  .battle__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .battle__board {
    flex: 1 1 auto;
    height: auto;
    min-height: 200px;
    padding: 6px;
  }
  .battle__side-toggle {
    display: block;
    flex: none;
    margin: 0 6px;
    padding: 6px;
    background: #161a20;
    border: 1px solid #2a313c;
    border-radius: 8px 8px 0 0;
    color: #8b95a3;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
  }
  .battle__side {
    flex: 0 1 auto;
    max-height: 35%;
    overflow-y: auto;
    padding: 8px 6px 12px;
    background: #161a20;
    border-top: 1px solid #2a313c;
  }
  .battle--side-closed .battle__side {
    display: none;
  }
  .battle__actions {
    position: static;
    flex: 0 0 auto;
    max-height: 40%;
    padding: 6px;
  }
  .battle__actions > .panel {
    padding: 10px;
  }
  .frame--viewer .frame__body {
    min-height: 0;
  }
  .topbar__layout {
    display: none;
  }
  .dock {
    display: contents;
  }
  .toast {
    min-width: 0;
    width: calc(100% - 20px);
    top: 12px;
  }
  .gameover__card {
    min-width: 0;
    margin: 0 10px;
  }
  .notice {
    max-width: calc(100vw - 24px);
  }
  .modal {
    padding: 16px 8px;
  }
}
@media (pointer: coarse) {
  .btn {
    min-height: 40px;
  }
  .btn--tiny {
    min-width: 40px;
  }
  .input {
    min-height: 40px;
    font-size: 16px;
  }
  .zoom__btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .frame__title,
  .steps__step,
  .battle__side-toggle,
  .topbar__home,
  .topbar__version {
    min-height: 40px;
  }
  .unit__handle-hit {
    pointer-events: all;
  }
}
.die--miss {
  opacity: 0.45;
  text-decoration: line-through;
}

.ai-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-controls__busy {
  color: #f5b83d;
}

.unit-card__role {
  margin: 2px 0;
}

.setup__main > .solo {
  margin-bottom: 12px;
}

.ai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 8px;
}
.ai-table th {
  text-align: left;
  font-weight: 600;
  opacity: 0.7;
}
.ai-table td,
.ai-table th {
  padding: 2px 4px;
}
.ai-table tr {
  cursor: pointer;
}
.ai-table .num {
  text-align: right;
}

.ai-table__done {
  opacity: 0.45;
}

.ai-shot {
  stroke: #ff3b30;
  stroke-width: 0.12;
  stroke-dasharray: 0.3 0.3;
  stroke-linecap: round;
  opacity: 0.85;
  pointer-events: none;
}
