/* Build panel */

.bp-thumb {
  display: grid;
  place-items: center;
}

.bp-thumb > canvas {
  max-width: 52px;
  max-height: 52px;
}

.bp-new .bp-thumb,
.mm-new .mm-swatch-canvas {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 18px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: var(--radius-sm);
}

.bp-badge.custom {
  left: 4px;
  right: auto;
  color: var(--accent-2);
}

.bp-search-row {
  display: flex;
  gap: 8px;
}

.bp-foot {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.bp-foot .btn {
  flex: 1;
}

.bp-hint {
  grid-column: 1 / -1;
  margin: 4px 2px;
}

.variant-row,
.variant-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-2);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.variant.small {
  min-width: 0;
  padding: 3px;
}

.variant:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2));
}

.variant.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text);
}

.tag-btn {
  cursor: pointer;
  border: 1px solid var(--line-2);
  font: inherit;
}

.tag-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Asset library */

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

.lib-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.lib-search {
  flex: 1;
  min-width: 160px;
}

.lib-blurb {
  margin: 0;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  padding: 2px;
}

.lib-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  font: inherit;
}

button.lib-card {
  cursor: pointer;
}

.lib-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2));
}

.lib-thumb {
  display: grid;
  place-items: center;
  height: 84px;
  border-radius: 8px;
  background:
    conic-gradient(rgba(127, 127, 127, 0.12) 25%, transparent 0 50%, rgba(127, 127, 127, 0.12) 0 75%, transparent 0) 0 0 / 16px 16px,
    var(--panel-3);
}

.lib-new .lib-thumb {
  background: none;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  font-size: 22px;
}

.lib-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lib-meta b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.lib-meta small {
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.lib-actions:empty {
  display: none;
}

/* Map maker */

.mm-tools {
  flex-wrap: wrap;
}

.mm-swatch {
  position: relative;
}

.mm-swatch .px-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

.mm-swatch-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  color: var(--accent-2);
}

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

.mm-head-row h4 {
  margin: 0;
}

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

.mm-map {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
}

.mm-map-pic {
  display: grid;
  place-items: center;
  width: 96px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  background: #1b1d2a;
}

.mm-map-pic canvas {
  max-width: 96px;
  max-height: 72px;
}

.mm-map-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mm-map-meta b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-map-meta small {
  font-size: 11.5px;
}

.mm-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.mm-mark.spawn .fa-solid {
  font-size: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

/* Avatar editor */

.avatar-editor {
  grid-template-columns: 260px minmax(0, 1fr);
}

.ae-preview .pv-stage {
  width: 260px;
  height: 230px;
  background: #cdb490;
}

.pv-floor-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pv-px {
  left: 50%;
  bottom: -3px;
  transform: translateX(-50%) scale(1.5);
  transform-origin: 50% 100%;
}

.pv-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pv-actions .btn[hidden] {
  display: none;
}

.ae-preview .pv-name {
  top: 12px;
}

.pv-stage .pv-avatar {
  top: auto;
  bottom: 38px;
  width: 120px;
  height: 0;
  margin: 0 0 0 -60px;
}

.pv-stage:not(.emoji-mode) .pv-body {
  display: none;
}

.pv-stage.emoji-mode .pv-px {
  display: none;
}

.pv-stage.emoji-mode .pv-avatar {
  height: 120px;
  bottom: 40px;
}

.pv-stage:not(.emoji-mode) .pv-shadow {
  bottom: -6px;
  width: 64px;
  height: 14px;
  margin-left: -32px;
  background: rgba(40, 24, 10, 0.25);
}

.pv-trail .spr {
  position: absolute;
  transform: scale(0.75);
}

.ae-identity {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ae-tabs {
  margin-bottom: 10px;
}

.ae-mode {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(56vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.ae-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ae-preset,
.ae-opt {
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 10px;
  border: 1.5px solid var(--line-2);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

.ae-preset:hover,
.ae-opt:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2));
}

.ae-opt.active,
.ae-preset.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
}

.ae-random {
  min-width: 52px;
  gap: 2px;
  font-size: 11px;
}

.ae-random .fa-solid {
  font-size: 18px;
  color: var(--accent);
}

.ae-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ae-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ae-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ae-opt-pic {
  width: 32px;
  height: 48px;
}

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

.swatch.small {
  width: 18px;
  height: 18px;
}

.ae-drawn {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.ae-drawn-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1.5px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ae-drawn-card span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ae-drawn-card.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
}

.ae-drawn-card.new .ae-drawn-pic {
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  font-size: 20px;
}

.ae-drawn-pic {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--panel-3);
}

.chip .px-thumb {
  width: 16px;
  height: 16px;
}

.item-pic {
  width: 24px;
  height: 24px;
}

.desk-free-pic,
.desk-note-icon,
.station-icon,
.tz-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.desk-free-pic {
  width: 64px;
  height: 64px;
  font-size: 34px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.desk-note-icon {
  width: 32px;
  height: 32px;
  font-size: 18px;
}

.station-icon {
  font-size: 22px;
}

.tz-icon {
  width: 28px;
  font-size: 18px;
}

.rank.r1 {
  color: #f4c430;
}

.rank.r2 {
  color: #b8c0cc;
}

.rank.r3 {
  color: #d08a4b;
}

@media (max-width: 760px) {
  .avatar-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .ae-preview .pv-stage {
    width: 100%;
  }
}

/* Brand */

.brand-banner {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1806 / 447;
  margin: 0 auto 6px;
  background: url('/img/banner.webp') center / contain no-repeat;
}

.brand-logo {
  display: inline-block;
  flex: none;
  width: 28px;
  height: 28px;
  background: url('/img/logo.png') center / contain no-repeat;
}

:root:not([data-theme='light']) .brand-banner {
  background-image: url('/img/banner-dark.webp');
}

:root:not([data-theme='light']) .brand-logo {
  background-image: url('/img/logo-dark.png');
}

.brand-logo.sm {
  width: 24px;
  height: 24px;
}

.brand-logo.md {
  width: 48px;
  height: 48px;
}

.brand-logo.lg {
  width: 64px;
  height: 64px;
}

/* Who made a community asset */

.bp-by,
.ae-drawn-by {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
}

.lib-by {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.lib-by span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-by .fa-solid {
  font-size: 10px;
}

/* Avatar editor: showing the Slack picture instead of the avatar */

.pv-photo {
  display: none;
}

.pv-stage.photo-mode .pv-px,
.pv-stage.photo-mode .pv-body {
  display: none;
}

.pv-stage.photo-mode .pv-photo {
  display: block;
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 92px;
  height: 92px;
  margin-left: -46px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  box-shadow: 0 0 0 4px var(--ring), 0 8px 16px rgba(20, 22, 40, 0.3);
  animation: breathe 2.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.ae-show {
  width: 100%;
}

.ae-photo-note {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-2);
  background: var(--accent-soft);
}

.ae-photo-note i {
  margin-top: 2px;
  color: var(--accent-text);
}

.avatar-editor.showing-photo .ae-photo-note {
  display: flex;
}

.avatar-editor.showing-photo .ae-tabs,
.avatar-editor.showing-photo .ae-mode {
  opacity: 0.55;
}
