/* The original theme.scss, with fonts served locally. */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  src: url("/assets/vendor/opensans/open-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 700;
  src: url("/assets/vendor/opensans/open-sans-700.woff2") format("woff2");
}

:root {
  --muted: #909090;
  --danger: #e04545;
  /* Declare the native scheme so dark-mode extensions leave us alone. */
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background-color: black;
  color: #ded8d5;
  font-family: "Open Sans", Arial, Verdana;
  font-size: 0.8125em;
  -webkit-text-size-adjust: none;
}

.app { min-height: 100vh; }
.startup { min-height: 100vh; background: #000; }

button {
  background-image: radial-gradient(#b08d57 10%, #804a00);
  color: #ffeecc;
  box-sizing: border-box;
  border: 1px solid #aa9977;
  border-radius: 8px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: inherit;
  font-weight: bold;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  cursor: pointer;
}
button:hover:not(:disabled):not(.fa):not(.icon):not(.styled),
button:focus:not(:disabled):not(.fa):not(.icon):not(.styled) {
  background: radial-gradient(#b08d57, 80%, #804a00);
  outline: none;
}
button:disabled:not(.fa):not(.icon) {
  background: radial-gradient(#ded8d5 10%, #444);
  color: inherit;
  border: 1px solid #ded8d5;
  opacity: 0.4;
  cursor: default;
}
button.styled, button.link {
  border: 0 none;
  background-color: transparent;
  background-image: none;
  color: inherit;
  font-weight: normal;
  text-shadow: none;
}
button.link { text-decoration: underline; }
a, button.link { color: #00ffff; }
a:hover, button.link:hover { color: #ccffff; text-decoration: underline; }

input {
  background: transparent;
  border: 1px solid #804a00;
  border-radius: 2px;
  color: #ded8d5;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 14px;
}
input:focus { outline: 1px solid #b08d57; }

/* Auth: centered like the original intro screens. */
.auth {
  max-width: 360px;
  margin: 18vh auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.auth h1 { margin-bottom: 0; letter-spacing: 1px; font-size: 2em; }
.auth p { color: var(--muted); margin-top: 0; }
.entry {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.entry h1 { margin: 0; letter-spacing: 1px; font-size: 2em; }
.entry button { font-size: 1.1em; padding: 6px 16px; }

/* Lobby: the original online.html page with bronze tabs. */
.page {
  width: 100%;
  max-width: 836px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.page > header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px 0 8px;
  font-size: 1.2em;
}
.page > header button {
  display: inline-block;
  border-radius: 2px;
  border: 1px solid #804a00;
  padding: 0 8px;
  background: none;
  color: #ded8d5;
  font-weight: normal;
  text-shadow: none;
  line-height: 1.6em;
}
.page > header button:hover { background: #1a1208; }
.page > header .account { color: #ffeecc; }

.announcement {
  margin: 8px 8px 0;
  border: 1px solid #804a00;
  border-radius: 4px;
  padding: 7px 10px;
  background: rgba(128, 74, 0, 0.28);
  color: #ffeecc;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tabs { margin-top: 8px; user-select: none; }
.tabs ul {
  display: flex;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #804a00;
  width: 100%;
  justify-content: center;
  list-style: none;
}
.tabs li {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  padding: 0.4em 0.8em;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tabs li.is-active {
  background: linear-gradient(to right, #804a00 10%, 40%, #b08d57 60%, 80%, #804a00 90%);
  border-bottom-color: #ded8d5;
  cursor: default;
}
.tabs li.is-active .label {
  color: white;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
/* Original tab count badge: a small bronze pill after the label. */
.tabs li .badge {
  margin-left: 0.5em;
  padding: 0 0.45em;
  border-radius: 0.7em;
  background: #804a00;
  color: #ded8d5;
  font-size: 0.75em;
  line-height: 1.4;
}
.tabs li.is-active .badge { background: #41342b; }

/* The original lobby's arena grid: 14 slots, empties create a game. */
.arena-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 8px 0;
}
.arena-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 92px;
  border: 1px solid #804a00;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at center, rgba(176, 141, 87, 0.25), rgba(0, 0, 0, 0.6)),
    #161616;
  cursor: pointer;
  user-select: none;
}
.arena-slot:hover { border-color: #ded8d5; }
.arena-slot.empty .plus { font-size: 28px; color: #804a00; }
.arena-slot.empty:hover .plus { color: #ded8d5; }
.arena-slot .vs .name { color: #b08d57; }
.arena-slot .meta { font-size: 11px; color: #888; }
.arena-slot .action {
  color: #ded8d5;
  font-size: 12px;
  border: 1px solid #804a00;
  border-radius: 8px;
  padding: 1px 10px;
}

/* The little (i) explainer buttons in popups. */
button.info-btn {
  width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #804a00;
  background: none;
  color: #b08d57;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
}
button.info-btn:hover { color: #ded8d5; border-color: #ded8d5; }

.show-results { cursor: pointer; user-select: none; }

/* Turn clocks on the player banners (original .clock long/short). */
.player .clock { margin-left: 8px; font-weight: bold; }
.player .clock.long { color: #ded8d5; }
.player .clock.short { color: #ff4444; }

/* Connection-lost banner while reconnecting. */
.connection-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 4px;
  text-align: center;
  background: #802020;
  color: #fff;
  font-size: 13px;
}

/* Rankings tab rows: rank number, favorite star, rating column. */
.game-list .rank { min-width: 2em; color: #b08d57; }
.game-list .star {
  background: none;
  border: 0;
  color: #e5d34f;
  cursor: pointer;
  font-size: 14px;
  padding: 0 6px;
}
.game-list.community .row .vs { flex: 1; }
.lobby-header .controls input { max-width: 12em; }

.builder-slot { display: flex; gap: 8px; margin-bottom: 8px; }
.builder-slot select { flex: 1; }
.builder-slot input { flex: 1; min-width: 0; }

.tabContent { padding: 8px; }
.tabContent .actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }

/* The original lobby tab header: style selector left, small bronze
   control buttons right (.tabContent HEADER in online.html). */
.lobby-header {
  display: flex;
  align-items: center;
  padding: 4px 8px 8px;
}
.lobby-header .style { flex-grow: 1; }
.lobby-header .style select {
  background: #1a1208;
  border: 1px solid #804a00;
  color: #ded8d5;
  padding: 3px 6px;
  font-family: inherit;
}
.lobby-header .controls { display: flex; align-items: center; flex-shrink: 0; }
.lobby-header .controls button {
  height: 18px;
  margin-right: 12px;
  border: 1px solid #b08d57;
  border-radius: 2px;
  padding: 0 4px;
  line-height: 16px;
  font-weight: normal;
  font-size: 0.8333em;
  background: none;
  color: #b08d57;
  text-shadow: none;
}
.lobby-header .controls button:hover {
  background: none;
  border-color: #ffcc00;
  color: #ffcc00;
}
.lobby-header .controls button:last-child { margin-right: 0; }
.game-list .row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border-bottom: 1px solid #1c1c1c;
}
.game-list .row .vs { flex: 1; }
.game-list .row .vs .name { color: #b08d57; font-weight: bold; }
.game-list .row .type { color: var(--muted); flex: 0 1 170px; }
.game-list .empty { color: var(--muted); padding: 16px 8px; font-style: italic; }
.game-sections { display: flex; flex-direction: column; gap: 14px; }
.game-section h3 {
  margin: 0 0 4px;
  color: #b08d57;
  font-size: 13px;
  font-weight: normal;
  text-transform: uppercase;
}

/* Game screen — the original game.html layout: board canvas with player
   banners overlaid, play buttons top-right, settings bottom-right. */
/* In an actual game the board centers in the window, like the original. */
.game {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
#game { position: relative; width: 836px; max-width: 100vw; }
#field { position: relative; }
pixi-board { display: block; user-select: none; width: 100%; }
pixi-board canvas { display: block; }

#alert {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 18px;
  line-height: 18px;
  border-radius: 16px;
  padding: 0 8px;
  background-color: #ded8d5;
  color: #000;
  font-weight: bold;
  z-index: 2;
}

/* Player banners (original .player bars with the bronze gradient). */
.player {
  display: flex;
  align-items: center;
  position: absolute;
  min-width: 200px;
  height: 20px;
  box-sizing: border-box;
  padding: 0 24px;
  line-height: 20px;
  z-index: 1;
}
.player .status {
  position: absolute;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.2) 25%, rgba(0, 0, 0, 0.8));
}
.player .status.active {
  background: radial-gradient(circle at 50% 50%, rgba(0, 255, 0, 0.8) 25%, rgba(0, 0, 0, 0.8));
}
.player .name {
  color: #fff;
  margin: 0 6px;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.player.left {
  flex-direction: row;
  left: 0;
  top: 0;
  border-radius: 10px 0 0 10px;
}
.player.left .status { left: 3px; }
.player.left::after {
  position: absolute;
  top: 2px;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 20px 8px 0;
  border-color: transparent black transparent transparent;
  content: " ";
}
.player.left.bronze {
  background-image: linear-gradient(to right, #804a00 10%, 40%, #b08d57 60%, 80%, #804a00 90%, transparent 102%);
}
.player.right {
  flex-direction: row-reverse;
  right: 0;
  bottom: 0;
  border-radius: 0 10px 10px 0;
}
.player.right .status { right: 3px; }
.player.right::after {
  position: absolute;
  top: 2px;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 20px;
  border-color: transparent transparent transparent black;
  content: " ";
}
.player.right.bronze {
  background-image: linear-gradient(to left, #804a00 10%, 40%, #b08d57 60%, 80%, #804a00 90%, black 102%);
}

/* Button bars (original #game-play / #game-settings, using the core
   bundle's own button images via CSS variables set by the renderer). */
.buttons {
  display: flex;
  flex-direction: row;
  position: absolute;
  right: 0;
  padding: 6px;
  z-index: 30;
  user-select: none;
}
.buttons.game-play { top: 20px; }
.buttons.game-settings { bottom: 16px; }
/* GameSettings "bar position: left" docks both bars on the other side. */
.game.bars-left .buttons { right: auto; left: 0; }
.buttons button {
  box-sizing: content-box;
  flex: 0 0 auto;
  margin: 3px;
  border: 0 solid #ded8d5;
  border-radius: 0;
  padding: 0;
  width: 34px;
  height: 34px;
  background: none no-repeat center transparent;
  color: #ded8d5;
  font-size: 18px;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
}
.buttons button:hover:not(:disabled) { color: #fff; border-color: #ded8d5; }
.buttons button.selected { margin: 1px; border-width: 2px; cursor: default; }
.buttons button.ready {
  border-radius: 20px;
  animation: glow ease-in-out 1s infinite;
}
/* Disabled bar buttons keep their image, faded like the original. */
.buttons button:disabled {
  border-width: 0;
  opacity: 0.4;
  cursor: default;
}
.buttons button.selected:disabled { border-width: 2px; }
.buttons button:hover:not(:disabled),
.buttons button:focus:not(:disabled) {
  background-color: transparent;
  outline: none;
}
.buttons .icon-move { background-image: var(--btn-move, url("/icons/btn_move.png?v=core-icons-20260613")); border-color: #0088ff; }
.buttons .icon-attack { background-image: var(--btn-attack, url("/icons/btn_attack.png?v=core-icons-20260613")); border-color: #ff8800; }
.buttons .icon-turn { background-image: var(--btn-turn, url("/icons/btn_turn.png?v=core-icons-20260613")); border-color: #ffe991; }
.buttons .icon-pass { background-image: var(--btn-pass, url("/icons/btn_pass.png?v=core-icons-20260613")); border-color: #ffffff; }
.buttons .icon-surrender { background-image: var(--btn-surrender, url("/icons/btn_surrender.png?v=core-icons-20260613")); border-color: #ffffff; }
/* Themed bar icons painted in the core buttons' style (make_icons.mjs). */
.buttons .icon-chat { background-image: url("/icons/btn_chat.png?v=chat-scroll-bright15-20260612"); border-color: #ffffff; }
.buttons .icon-home { background-image: url("/icons/btn_home.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-settings { background-image: url("/icons/btn_settings.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-replay { background-image: url("/icons/btn_replay.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-share { background-image: url("/icons/btn_share.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-undo { background-image: url("/icons/btn_undo.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-rotate-0 { background-image: url("/icons/btn_rotate-0.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-rotate-90 { background-image: url("/icons/btn_rotate-90.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-rotate-180 { background-image: url("/icons/btn_rotate-180.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-rotate-270 { background-image: url("/icons/btn_rotate-270.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-rew-start { background-image: url("/icons/btn_rew-start.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-rew { background-image: url("/icons/btn_rew.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-play { background-image: url("/icons/btn_play.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-pause { background-image: url("/icons/btn_pause.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-fwd { background-image: url("/icons/btn_fwd.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-fwd-end { background-image: url("/icons/btn_fwd-end.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-fork { background-image: url("/icons/btn_fork.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .icon-resume { background-image: url("/icons/btn_resume.png?v=rest-icons-refbg-20260612b"); border-color: #ffffff; }
.buttons .special { width: auto; padding: 0 10px; border-width: 1px; font-size: 13px; }

@keyframes glow {
  0% { box-shadow: none; }
  50% { box-shadow: 0 0 14px 4px #ffffff; }
  100% { box-shadow: none; }
}

/* Unit info card (original #card overlay: a 176x100 canvas). */
#card {
  display: block;
  position: absolute;
  top: 20px;
  left: 0;
  width: 176px;
  height: 100px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

/* Chat (original #chat panel under the board). */
#chat {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 25;
  background: #000;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
}
#chat #messages { display: flex; flex-direction: column; overflow: auto; max-height: 140px; }
#chat .message { line-height: 18px; word-break: break-word; font-size: 13px; }
#chat .message .chat-player { color: #b08d57; font-weight: bold; }
#chat .message .chat-player::after { content: ":"; }
#chat .message .content { white-space: pre-wrap; }
#chat .new-message {
  box-sizing: border-box;
  border: 0 none;
  border-radius: 0;
  border-left: 1px solid #b08d57;
  margin-top: 4px;
  padding: 4px;
  width: 100%;
  background-color: transparent;
  color: inherit;
  line-height: 18px;
}
#chat .new-message:focus { outline: 1px solid #b08d57; }
#chat .new-message::placeholder {
  padding-left: 4px;
  color: #b08d57;
  font-weight: bold;
  opacity: 1;
  font-style: italic;
}
#chat .new-message:focus::placeholder { opacity: 0; }

.waiting { text-align: center; padding: 20vh 0; }

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: #140909;
  border-radius: 3px;
  padding: 10px 18px;
  font-weight: 700;
  z-index: 200;
}
.toast.ok { background: #58c470; bottom: 60px; }

/* Modals (the original popup.scss look). */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
}
.popup {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 16px;
  border: 1px solid #aa9977;
  border-radius: 4px;
  min-width: 340px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 6px 8px 10px #000;
}
.popup .title {
  background: linear-gradient(to right, #804a00 10%, 40%, #b08d57 60%, 80%, #804a00 90%);
  padding: 4px 8px;
  color: white;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.popup .message { padding: 12px 8px; overflow: hidden auto; }
.popup .form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.popup .form-label { width: 80px; color: #b08d57; font-weight: bold; text-align: right; }
.popup .form-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.popup .form-field label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.popup select {
  background: #1a1208;
  border: 1px solid #804a00;
  color: #ded8d5;
  padding: 4px 6px;
  font-family: inherit;
}
.popup .style-blurb { color: var(--muted); margin: 2px 0 6px 90px; max-width: 330px; font-size: 0.95em; }
.popup .dim { color: var(--muted); }
.popup .mono { font-family: Consolas, "Courier New", monospace; font-size: 0.9em; }
.popup .linked { color: #58c470; font-weight: bold; }
.popup .relation-person { padding: 0; }
.popup .set-preview {
  width: min(520px, calc(100vw - 64px));
}
.popup-buttons { padding: 8px 8px 4px; text-align: center; }
.popup-buttons button { margin: 8px 4px 0; min-width: 6em; }

/* Taomaster-style setup overview and set builder */
.view.setup.taomaster-setup {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: stretch;
  gap: 24px;
  position: relative;
  overflow: visible;
  padding: 8px;
}
.taomaster-setup .sets {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  flex: 1 1 auto;
  max-width: 548px;
}
.taomaster-setup .sets:not(.isCustomizable) {
  display: block;
  max-width: 362px;
}
.taomaster-setup .sets:not(.isCustomizable) .set:not(:first-child) {
  display: none;
}
.taomaster-setup .set {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(176, 141, 87, 0.45);
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.taomaster-setup .set:hover,
.taomaster-setup .set:focus-within {
  border-color: #b08d57;
  box-shadow: 0 0 10px rgba(176, 141, 87, 0.3);
}
.taomaster-setup .set .details {
  position: absolute;
  top: 4px;
  left: 6px;
  right: 6px;
  z-index: 1;
  color: #b08d57;
  font-weight: bold;
  font-style: italic;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  pointer-events: none;
}
.taomaster-setup .set .details .name {
  color: #ffeecc;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.taomaster-setup .set .details .stats,
.taomaster-setup .set .details .stock {
  font-size: 11px;
}
.taomaster-setup .set .image {
  position: relative;
  width: 100%;
  aspect-ratio: 1.49 / 1;
  overflow: hidden;
}
.taomaster-setup .set .image pixi-board {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.taomaster-setup .selectors {
  flex: 0 0 210px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  color: #b08d57;
  font-weight: bold;
}
.taomaster-setup .selectors label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.taomaster-setup .selectors .container {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(176, 141, 87, 0.6);
  background: rgba(0, 0, 0, 0.35);
  color: #ffeecc;
  border-radius: 2px;
  text-shadow: none;
}
.taomaster-setup .selectors .swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1px solid #ded8d5;
}
.swatch.color-0 { background: #538fbf; }
.swatch.color-1 { background: #bf4545; }
.swatch.color-2 { background: #8fbf5a; }
.swatch.color-3 { background: #e5d34f; }
.swatch.color-4 { background: #8d79ad; }
.swatch.color-5 { background: #e59a3d; }
.taomaster-setup .teams .image {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(176, 141, 87, 0.55);
  background:
    radial-gradient(circle, rgba(176, 141, 87, 0.12) 0 34%, transparent 35%),
    conic-gradient(from 45deg, rgba(83, 143, 191, 0.6), rgba(191, 69, 69, 0.6), rgba(229, 211, 79, 0.6), rgba(143, 191, 90, 0.6), rgba(83, 143, 191, 0.6));
}
.taomaster-setup .positions {
  position: absolute;
  inset: 18px;
}
.taomaster-setup .position {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #ffeecc;
  border-radius: 50%;
  background: #804a00;
}
.taomaster-setup .position.N { top: 0; left: 50%; transform: translateX(-50%); }
.taomaster-setup .position.E { right: 0; top: 50%; transform: translateY(-50%); }
.taomaster-setup .position.S { bottom: 0; left: 50%; transform: translateX(-50%); }
.taomaster-setup .position.W { left: 0; top: 50%; transform: translateY(-50%); }
.taomaster-setup .team-note {
  margin-top: 6px;
  text-align: center;
  color: #ded8d5;
  font-weight: normal;
}
.taomaster-builder {
  background: #000;
  padding: 8px;
}
.modal.setBuilder {
  width: min(100vw, 980px);
  min-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  background: #000;
  color: #ded8d5;
}
.modal.setBuilder .title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 8px;
  color: #b08d57;
  font-weight: bold;
  background: transparent;
}
.modal.setBuilder .title input.name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
  border: 0;
  color: #b08d57;
  font-weight: bold;
  font-style: italic;
  font-size: 18px;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.modal.setBuilder .title .style {
  flex: 0 0 auto;
  padding-left: 12px;
  color: #ffeecc;
}
.modal.setBuilder .content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.modal.setBuilder .field {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.setBuilder .field pixi-board {
  width: min(100%, 836px);
}
.modal.setBuilder .field .setup-card {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 210px;
  max-width: calc(100% - 16px);
  padding: 8px;
  border: 1px solid rgba(176, 141, 87, 0.7);
  background: rgba(0, 0, 0, 0.82);
  color: #ded8d5;
  opacity: 0.92;
  pointer-events: none;
}
.modal.setBuilder .field .setup-card .card-name {
  color: #ffeecc;
  font-weight: bold;
  text-align: center;
  margin-bottom: 6px;
}
.modal.setBuilder .field .setup-card .card-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  color: #b08d57;
}
.modal.setBuilder .field .setup-card .card-grid b {
  color: #ded8d5;
}
.modal.setBuilder .field .setup-card .card-ability {
  margin-top: 6px;
  color: #909090;
  text-align: center;
}
.modal.setBuilder .buttons {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
}
.modal.setBuilder .buttons button.fa {
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #b08d57;
  font-size: 20px;
  text-shadow: none;
}
.modal.setBuilder .buttons button.fa:hover:not(:disabled),
.modal.setBuilder .buttons button.fa:focus:not(:disabled) {
  border-color: #b08d57;
  color: #ffeecc;
}
.modal.setBuilder .buttons button.fa:disabled {
  color: #555;
  cursor: default;
}
.modal.setBuilder .buttons select.slot {
  height: 30px;
  background: #1a1208;
  border: 1px solid #804a00;
  color: #ded8d5;
}
.modal.setBuilder .buttons .close {
  min-width: 64px;
  border-radius: 2px;
}
.popup.modal.unitPicker {
  max-width: 728px;
  background: #000;
}
.unitPicker .message {
  padding: 0;
}
.unitPicker .tabs {
  display: flex;
  justify-content: stretch;
  border-bottom: 1px solid #804a00;
}
.unitPicker .tabs button {
  flex: 1 1 0;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #b08d57;
  text-shadow: none;
}
.unitPicker .tabs button.selected {
  color: #ffeecc;
  background-image: linear-gradient(#b08d57, #804a00);
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.unit-picker-pane {
  padding: 10px;
  min-height: 260px;
}
.unit-picker-pane .info {
  margin: 0 0 10px;
  color: #b08d57;
  font-weight: bold;
}
.unit-picker-pane .units {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.unit-picker-pane .unit {
  position: relative;
  width: 120px;
  min-height: 122px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #ded8d5;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.unit-picker-pane .unit:hover:not(:disabled),
.unit-picker-pane .unit:focus:not(:disabled) {
  border-color: #b08d57;
  background: rgba(176, 141, 87, 0.14);
}
.unit-picker-pane .unit .image {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(176, 141, 87, 0.65);
  border-radius: 50%;
  color: #ffeecc;
  background: radial-gradient(circle at 50% 35%, #3a2a18, #000);
  font-weight: bold;
}
.unit-picker-pane .unit label {
  display: block;
  min-height: 32px;
  text-align: center;
  font-weight: bold;
  pointer-events: none;
}
.unit-picker-pane .unit .count {
  color: #b08d57;
  font-size: 11px;
}
.unit-detail-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 90px 90px 90px;
  align-items: center;
  gap: 1px;
  background: rgba(128, 74, 0, 0.35);
}
.unit-detail-grid > * {
  min-height: 30px;
  padding: 5px 8px;
  background: #050505;
}
.unit-detail-grid .head {
  color: #b08d57;
  font-weight: bold;
}
.unit-detail-grid .unit-detail-name {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: #050505;
  color: #ffeecc;
  text-shadow: none;
}

@media (max-width: 760px) {
  .view.setup.taomaster-setup {
    flex-direction: column;
    gap: 14px;
  }
  .taomaster-setup .sets {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .taomaster-setup .selectors {
    flex: 0 0 auto;
  }
  .taomaster-setup .teams .image {
    width: 132px;
    height: 132px;
  }
  .modal.setBuilder .title {
    align-items: stretch;
    flex-direction: column;
    gap: 2px;
  }
  .modal.setBuilder .title .style {
    padding-left: 8px;
  }
  .unit-detail-grid {
    grid-template-columns: minmax(120px, 1fr) 70px 70px 70px;
    font-size: 12px;
  }
}
