/* 配置（builds）相關樣式 —— 沿用 style.css 定義的色彩變數 */

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0; }
.actions .inline { display: inline; margin: 0; }
.hint { color: var(--ink-3); font-size: 14px; margin: 20px 0; }

button.btn { font: inherit; cursor: pointer; border: none; }

.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }

/* ---------------------------------------------------------------- 槽位圖示 */

.slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  flex: none;
}
.slot.xs { width: 25px; height: 25px; border-radius: 3px; }
.slot.sm { width: 34px; height: 34px; }
.slot.md { width: 46px; height: 46px; }
.slot.lg { width: 62px; height: 62px; }
.slot img { width: 100%; height: 100%; object-fit: contain; display: block; }

.slot.blank { border-style: dashed; background: transparent; }
.slot.broken { border-style: dotted; }

/* 「不限制」：隊長明確開放這格自選。金色虛線框＋粗體「任」字 */
.slot.any { border: 1px dashed var(--gold-dim); background: transparent; }
.slot.any em { font-style: normal; font-weight: 700; color: var(--gold); font-size: 18px; }
.slot.xs.any em { font-size: 11px; }
.slot.sm.any em { font-size: 14px; }
.slot.lg.any em { font-size: 24px; }

/* ---------------------------------------------------------------- 配置卡片 */

.buildgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.buildcard {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 16px 18px;
  color: var(--ink);
}
.buildcard:hover { text-decoration: none; border-color: var(--gold-dim); }
.buildcard.archived { opacity: 0.5; }

.bc-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.bc-head h2 { font-family: var(--f-display); font-size: 19px; margin: 0; flex: 1; }
.bc-head .filled {
  font-family: var(--f-num);
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.buildcard .slots { display: flex; flex-wrap: wrap; gap: 5px; }

.bc-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bc-archived { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- 配置詳情 */

blockquote.note {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-left: 3px solid var(--gold-dim);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 15px;
}

table.slottable { border-collapse: collapse; width: 100%; }
.slottable td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.slottable tr:last-child td { border-bottom: none; }
.slottable .s-icon { width: 1%; }
.slottable .s-label { font-family: var(--f-label); text-transform: uppercase; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; width: 1%; }
.slottable .s-name { font-size: 15px; }
.slottable .none { color: var(--ink-3); }
.th { font-style: normal; font-size: 11px; color: var(--gold); margin-left: 6px; }

/* ---------------------------------------------------------------- 編輯器 */

.buildform { max-width: 760px; }

.field { display: block; margin: 0 0 24px; }
.field > span { font-family: var(--f-label); text-transform: uppercase; letter-spacing: 0.08em; display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; }
.field > span em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.field input[type="text"], .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 3px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold-dim); }

.editgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin: 0 0 26px;
}

.editslot { display: flex; align-items: stretch; }
.editslot.disabled { opacity: 0.45; }

.editslot .pick {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 4px 0 0 4px;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.editslot .pick:hover:not(:disabled) { border-color: var(--gold-dim); }
.editslot .pick:disabled { cursor: not-allowed; }

.editslot .thumb {
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px dashed var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.editslot .thumb img { width: 100%; height: 100%; object-fit: contain; }
.editslot .thumb .anythumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--gold);
  font-weight: 700;
  font-size: 18px;
}

.editslot .meta { min-width: 0; }
.editslot .lbl { font-family: var(--f-label); text-transform: uppercase; display: block; font-size: 11.5px; color: var(--ink-3); }
.editslot .val {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editslot .clear {
  flex: none;
  width: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 4px 4px 0;
  color: var(--ink-3);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.editslot .clear:hover:not(:disabled) { color: var(--gold); }
.editslot .clear:disabled { cursor: not-allowed; }

.errors {
  border: 1px solid #6d3a30;
  background: #2a1c19;
  padding: 14px 18px;
  margin: 0 0 24px;
  max-width: 760px;
}
.errors p { margin: 0 0 6px; color: #e8907c; font-size: 14px; }
.errors ul { margin: 0; padding-left: 1.3em; font-size: 14px; color: var(--ink-2); }

/* ---------------------------------------------------------------- 裝備選擇器 */

body.picking { overflow: hidden; }

/* display:flex 的優先權高於瀏覽器對 [hidden] 的預設 display:none，
   沒有這一行的話彈窗會在頁面載入時就擋在畫面上。 */
.picker[hidden] { display: none; }

.picker {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.picker-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: min(820px, 100%);
  max-height: min(680px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.picker-head h2 { font-family: var(--f-display); font-size: 18px; margin: 0; white-space: nowrap; }

.picker-head input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 3px;
  font: inherit;
  font-size: 14px;
  min-width: 0;
}
.picker-head input:focus { outline: none; border-color: var(--gold-dim); }

.picker-head button {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.picker-head button:hover { color: var(--ink); }

.picker-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.picker-cats .cat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 3px;
  cursor: pointer;
}
.picker-cats .cat:hover { color: var(--ink); }
.picker-cats .cat.on { color: var(--gold); border-color: var(--gold-dim); }

.picker-grid {
  padding: 16px 18px 22px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  align-content: start;
}

.picker-grid .pitem {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 6px 8px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
}
.picker-grid .pitem:hover { border-color: var(--gold-dim); background: var(--surface); }
.picker-grid .pitem img { width: 54px; height: 54px; object-fit: contain; }
.picker-grid .pitem span {
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  word-break: break-word;
}
.picker-grid .pitem .th { position: absolute; top: 4px; right: 6px; margin: 0; }

.picker-grid .pitem .anyicon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--gold-dim);
  border-radius: 4px;
  color: var(--gold);
  font-weight: 700;
  font-size: 26px;
}

.picker-empty { grid-column: 1 / -1; color: var(--ink-3); text-align: center; padding: 32px 0; }

.btn.danger {
  background: transparent;
  color: #e8907c;
  border: 1px solid #6d3a30;
}
.btn.danger:hover { background: #2a1c19; color: #f3a996; }

/* 配置卡片上的建立者 */
.bc-owner {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}
