/* 自选编队确认 uses the shared preparation header and controls. */

.diy-check .diy-check__body {
  position: relative; z-index: 1; flex: 1; min-height: 0; overflow: auto;
  display: block; padding: 12px clamp(10px, 3vw, 40px);
}
.diy-check__roster {
  --diy-card: clamp(88px, 11vw, 134px);
  --diy-gap: clamp(6px, .8vw, 12px);
  --diy-tier: clamp(52px, 6vw, 86px);
  max-width: calc(6 * var(--diy-card) + 6 * var(--diy-gap) + var(--diy-tier) + 18px);
  margin-inline: auto;
}
.diy-check__lead, .diy-check__empty, .diy-check__hint {
  margin: 0; color: var(--text-lo); font-size: max(12px, calc(.16 * var(--utility-text, var(--t)))); line-height: 1.4;
}
.diy-check__lead { margin-block: 0 12px; }
.diy-check__empty { grid-area: 1 / 1; display: grid; place-items: center; min-height: clamp(92px, 14vw, 182px); }
.diy-check__tier {
  --diy-accent: var(--text-lo);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--diy-tier); gap: var(--diy-gap);
  margin-bottom: 12px; padding: 8px;
  border: 1px solid var(--line); background: rgba(8, 14, 14, .5);
}
.diy-check__tier[data-tier="5"] { --diy-accent: var(--tier-5); }
.diy-check__tier[data-tier="6"] { --diy-accent: var(--tier-6); }
.diy-check__tierhead {
  grid-area: 1 / 2; align-self: stretch; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border-inline-start: 1px solid var(--line);
  color: var(--diy-accent);
  background: rgba(255, 255, 255, .035);
  background: linear-gradient(270deg, color-mix(in srgb, var(--diy-accent) 8%, transparent), transparent);
}
.diy-check__tierhead .tier { --tier-h: clamp(25px, 2.4vw, 40px); }
.diy-check__count {
  color: var(--text-lo); font-size: max(14px, calc(.2 * var(--utility-text, var(--t))));
  font-weight: 400; line-height: 1;
}
.diy-check__count b { color: var(--mint-400); font-size: 1.24em; }
.diy-check__grid {
  grid-area: 1 / 1; display: grid; align-self: start;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--diy-card)), var(--diy-card)));
  gap: var(--diy-gap);
}
.diy-check__card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  min-width: 0; padding: 4px; text-align: start;
  background: rgba(17, 25, 23, .9); border: 1px solid var(--line-2);
  color: var(--text-hi); cursor: var(--sp-cursor-pointer, pointer);
}
.diy-check__card:disabled { cursor: var(--sp-cursor-default, default); }
.diy-check__card:not(:disabled):hover { border-color: var(--mint-600); }
.diy-check__card:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 2px; z-index: 1; }
.diy-check__card.is-on { border-color: var(--mint-400); box-shadow: inset 0 0 0 1px var(--mint-400); background: #142c25; }
.diy-check__portrait { position: relative; width: 100%; aspect-ratio: 5 / 6; overflow: hidden; background: #1e2926; }
.diy-check__art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
.diy-check__art.is-avatar { object-position: center; }
.diy-check__profession, .diy-check__picked {
  position: absolute; top: 0; width: 22px; height: 22px; padding: 3px;
}
.diy-check__profession { inset-inline-start: 0; object-fit: contain; background: rgba(0, 0, 0, .74); }
.diy-check__picked { inset-inline-end: 0; display: grid; place-items: center; background: var(--mint-400); color: var(--text-on-mint); }
.diy-check__picked .icon { width: 100%; height: 100%; }
.diy-check__build {
  position: absolute; inset: auto 0 0; display: flex; align-items: flex-end; gap: 3px; padding: 4px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .9), transparent);
}
.diy-check__build > span { display: grid; place-items: center; width: 25%; max-width: 30px; aspect-ratio: 1; background: #121918; }
.diy-check__name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: max(12px, calc(.16 * var(--utility-text, var(--t)))); font-weight: 700;
}
.diy-check__bonds { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-height: 15px; }
.diy-check__bonds .bglyph { width: clamp(14px, 1.15vw, 18px); height: clamp(14px, 1.15vw, 18px); }
.diy-check__card.is-banned > :not(.diy-check__why) { opacity: .36; filter: grayscale(1); }
.diy-check__why {
  position: absolute; inset-inline: 4px; bottom: 5px; padding: 3px;
  color: var(--text-lo); background: rgba(7, 11, 10, .92);
  font-size: max(10px, calc(.13 * var(--utility-text, var(--t)))); text-align: center;
}

.diy-check .diy-check__footer {
  position: relative; flex: none; flex-wrap: wrap; gap: 8px 16px;
  padding: 10px clamp(10px, 3vw, 40px);
}
.diy-check__hint { flex: 1 1 auto; margin-inline-end: auto; }

@media (max-width: 600px) {
  .diy-check__tier { grid-template-columns: minmax(0, 1fr); }
  .diy-check__tierhead {
    grid-area: auto; flex-direction: row; justify-content: flex-start; gap: 8px;
    padding-bottom: 5px; border-inline-start: 0; border-bottom: 1px solid var(--line); background: none;
  }
  .diy-check__grid, .diy-check__empty { grid-area: auto; }
}
