/* ============================================================
   球员试阵室 — 暗绿 + 烫金 · 移动优先 · 近乎直角（2-3px 圆角）
   ============================================================ */

@font-face {
  font-family: "pixel";
  src: url("assets/fonts/fusion-pixel-12px-monospaced-zh_hans.otf.woff2") format("woff2");
  font-display: swap;
}

/* ---------- 设计变量 ---------- */
:root {
  --bg: #0e1512;
  --panel: #16231c;
  --panel-deep: #10150f;
  --line: #2c3d33;
  --gold: #f7c948;
  --gold-dim: #b8902f;
  --text: #e6ece9;
  --muted: #8a9b8f;
  --danger: #c75a4a;
  --t-gold: #dcb543;
  --t-purple: #a06fff;
  --t-blue: #4ba3ff;
  --t-green: #34c56f;
  --t-white: #9aa6a0;
  --r: 3px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* hidden 属性必须彻底隐藏（部分元素样式里写了 display:flex，会覆盖 UA 的 [hidden] 规则） */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: radial-gradient(circle at 50% 22%, #1b2a22 0%, var(--bg) 72%) fixed;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  padding-bottom: calc(var(--safe-b) + 12px);
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}

input {
  font-family: inherit;
  color: var(--text);
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 10px;
  width: 100%;
  outline: none;
}
input:focus { border-color: var(--gold-dim); }

/* 球馆地板暗纹 */
#court-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background:
    radial-gradient(circle at 50% 30%, #f7c948 0 34%, transparent 35%),
    repeating-linear-gradient(0deg, transparent 0 119px, #f7c948 119px 120px),
    repeating-linear-gradient(90deg, transparent 0 119px, #f7c948 119px 120px);
}

#topbar,
#board-area,
#pool-head,
#pool,
#pool-empty,
#toasts {
  position: relative;
  z-index: 1;
}

/* ---------- 通用 ---------- */
.gold-btn {
  background: linear-gradient(180deg, #ffd968 0%, var(--gold) 45%, #c79a2a 100%);
  color: #241c06;
  font-weight: 700;
  border-radius: var(--r);
  padding: 7px 12px;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.gold-btn:active { transform: translateY(1px); }
.gold-btn:disabled { opacity: 0.45; pointer-events: none; }

.gold-ghost {
  color: var(--gold);
  border: 1px solid rgba(247, 201, 72, 0.55);
  border-radius: var(--r);
  padding: 5px 9px;
  font-size: 12px;
}
.gold-ghost:active { background: rgba(247, 201, 72, 0.14); }
.gold-ghost.danger { color: var(--danger); border-color: rgba(199, 90, 74, 0.55); }

.ghost-x { color: var(--muted); font-size: 20px; padding: 0 6px; line-height: 1; }

/* ---------- 顶栏 ---------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-t) + 8px) 12px 8px;
  background: linear-gradient(180deg, rgba(16, 21, 15, 0.98), rgba(16, 21, 15, 0.88));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(4px);
}

.top-title {
  font-family: "pixel", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: var(--gold);
  letter-spacing: 1px;
  white-space: nowrap;
}

.top-progress { flex: 1; color: var(--muted); font-size: 13px; }
.top-progress b { color: var(--gold); font-family: "pixel", monospace; font-size: 15px; }

.top-actions { display: flex; gap: 6px; align-items: center; }
.top-actions .sound { width: 30px; padding: 5px 0; }
.top-actions .sound.off { opacity: 0.45; text-decoration: line-through; }

/* ---------- 战术板 ---------- */
#board-area {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 12px 6px;
}

.board-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.board-title {
  font-family: "pixel", sans-serif;
  font-size: 14px;
  color: var(--gold);
}
.board-count { flex: 1; color: var(--muted); font-size: 12px; }
.board-count b { color: var(--text); font-family: "pixel", monospace; }

/* 帮助文本 */
.hint { color: #8a9b8f; font-size: 11px; }

/* ---------- 玩家牌（4×2） ---------- */
.players-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.player-card {
  position: relative;
  border: 1px solid rgba(247, 201, 72, 0.28);
  border-radius: var(--r);
  background: linear-gradient(180deg, #17241c, #0f1713);
  padding: 7px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: 64px;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.player-card:active { transform: scale(0.97); }
.player-card.full { border-color: var(--gold); }
.player-card.full .pcard-name { color: var(--gold); }

.player-card.on {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(247, 201, 72, 0.35), inset 0 0 8px rgba(247, 201, 72, 0.08);
  transform: translateY(-2px);
}

.pcard-name { font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-dots { display: flex; gap: 2px; }
.pcard-dot { width: 5px; height: 5px; border-radius: 50%; background: #2c3d33; }
.pcard-dot.on { background: var(--gold); }
.pcard-num { font-size: 10px; color: var(--muted); font-family: "pixel", monospace; }

/* ---------- 当前玩家槽位（5 横排） ---------- */
.active-panel {
  background: linear-gradient(180deg, #111b15, #0c1310);
  border: 1px solid rgba(247, 201, 72, 0.35);
  border-radius: 4px;
  padding: 8px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5);
}

.active-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.active-head b { color: var(--gold); font-size: 13px; }
.active-slots-num { flex: 1; font-size: 11px; color: var(--muted); }
.active-actions { display: flex; gap: 5px; }
.active-actions button { max-width: 46px; padding: 4px 5px; font-size: 11px; }
.active-panel .hintbar { margin-top: 6px; font-size: 11px; color: var(--gold); text-align: center; }

.slots-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  transition: box-shadow 0.2s;
}

.slot {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 2px dashed rgba(247, 201, 72, 0.28);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.slot:active { transform: scale(0.96); }

.slot .slot-num {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: "pixel", monospace;
  font-size: 10px;
  color: rgba(230, 236, 233, 0.55);
  z-index: 2;
}
.slot.empty .slot-plus { font-size: 20px; color: rgba(247, 201, 72, 0.45); }

.slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.slot .slot-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.78) 100%);
}
.slot .slot-name {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 3px;
  text-align: center;
  font-size: 11px;
  color: #fff;
  padding: 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot .slot-sub {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 16px;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 224, 130, 0.85);
}
.slot .slot-handle {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  cursor: grab;
  touch-action: none;
}
.slot.filled { border-style: solid; border-color: var(--tc, rgba(247, 201, 72, 0.4)); }

.slot-drop { /* 拖拽经过 */
  outline: 2px solid var(--gold);
  outline-offset: -1px;
  transform: scale(1.045);
  border-color: var(--gold);
}
.slots-row.awaiting .slot-empty { animation: breathe 1.2s ease-in-out infinite; }
.slots-row .slot-wait { animation: breathe 0.9s ease-in-out infinite; border-color: var(--gold); box-shadow: 0 0 12px rgba(247, 201, 72, 0.4); }
@keyframes breathe {
  0%, 100% { border-color: rgba(247, 201, 72, 0.25); }
  50% { border-color: var(--gold); box-shadow: 0 0 10px rgba(247, 201, 72, 0.35); }
}

/* 剪影兜底 */
.silhouette {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #22352a, #16231c);
}
.silhouette b { font-size: 30px; color: rgba(230, 236, 233, 0.35); }

/* ---------- 吸顶筛选区 ---------- */
#pool-head {
  position: sticky;
  top: 0;
  z-index: 25;
  background: linear-gradient(180deg, rgba(16, 22, 18, 0.97), rgba(16, 22, 18, 0.92));
  backdrop-filter: blur(4px);
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--line);
}
.filter-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.filter-bar input { flex: 1; min-width: 0; }
.pos-chips { display: flex; gap: 4px; }
.pos-chip {
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--r);
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
  min-width: 34px;
}
.pos-chip.on { color: var(--gold); border-color: var(--gold); background: rgba(247, 201, 72, 0.1); }

.switcher-bar {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.switcher-bar::-webkit-scrollbar { display: none; }
.sw-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 5px;
  align-items: center;
}
.sw-chip b { font-family: "pixel", monospace; font-weight: 400; }
.sw-chip.on { color: var(--gold); border-color: var(--gold); background: rgba(247, 201, 72, 0.1); }
.sw-chip.on::after { content: "▸"; font-size: 10px; }
.sw-chip.full::before { content: "✓ "; color: var(--gold); }

.active-filter-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.active-filter-chips:empty { margin: 0; }
.af-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(247, 201, 72, 0.12);
  border: 1px solid rgba(247, 201, 72, 0.45);
  color: var(--gold);
  font-size: 11px;
  border-radius: var(--r);
  padding: 2px 4px 2px 7px;
}
.af-chip button { color: inherit; padding: 0 2px; font-size: 13px; line-height: 1; }

.pool-meta { margin-top: 5px; font-size: 11px; color: var(--muted); }
.pool-meta b { color: var(--gold); font-family: "pixel", monospace; }

/* ---------- 球员池 ---------- */
#pool {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 12px 190px; /* 底部给 dock / 操作条留足空间，避免遮挡卡片 */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 560px) { #pool { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { #pool { grid-template-columns: repeat(4, 1fr); } }

.pcard {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, #16231c, #101813);
  padding: 6px;
  text-align: left;
  min-width: 0;
  border-left: 3px solid var(--c, var(--t-white));
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.pcard:active { transform: scale(0.98); }
.pcard.selected {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(247, 201, 72, 0.4);
}
.pcard.used { opacity: 0.66; }

.p-img {
  flex: 0 0 48px;
  width: 48px;
  height: 64px;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  background: #10150f;
}
.p-img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.p-img .silhouette b { font-size: 20px; }

.p-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.p-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-sub { font-size: 11px; color: var(--muted); }
.p-rating {
  position: absolute;
  right: 22px;
  top: 4px;
  font-family: "pixel", monospace;
  font-size: 11px;
  color: var(--c, var(--t-white));
}

.p-i {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  font-size: 15px;
  color: rgba(230, 236, 233, 0.5);
}
.p-tags { position: absolute; left: 6px; bottom: 4px; display: flex; gap: 3px; flex-direction: column; align-items: flex-start; }
.p-tag {
  font-size: 9px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(247, 201, 72, 0.4);
  border-radius: 2px;
  padding: 0 3px;
  white-space: nowrap;
}

.pool-empty { text-align: center; color: var(--muted); padding: 40px 0 120px; }
.pool-empty p { margin-bottom: 10px; }

/* ---------- 快捷放置条（Dock） ---------- */
#dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 10px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 21, 18, 0.96);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 8px 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  max-width: calc(100vw - 20px);
}
.dock-mini { display: flex; align-items: center; gap: 6px; min-width: 118px; }
.dock-mini .p-img { flex-basis: 40px; width: 40px; height: 56px; }
.dock-mini .p-name { font-size: 12px; max-width: 74px; }
.dock-mini .hint { font-size: 10px; color: var(--gold); }
.dock-chips { display: flex; gap: 5px; }
.dock-chip {
  min-width: 40px;
  height: 44px;
  border: 1px dashed rgba(247, 201, 72, 0.4);
  border-radius: var(--r);
  color: var(--gold);
  font-family: "pixel", monospace;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.25);
}
.dock-chip.filled { border-style: solid; border-color: var(--tc, var(--gold-dim)); color: var(--text); background: rgba(0, 0, 0, 0.45); }
.dock-chip img { width: 26px; height: 30px; object-fit: cover; object-position: center top; border-radius: 2px; }
.dock-chip span { max-width: 38px; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; }
#dock.fullmode .dock-chip { opacity: 0.45; pointer-events: none; }
#dock.fullmode .dock-mini .hint { color: var(--danger); }
.dock-close { color: var(--muted); font-size: 16px; padding: 4px 6px; }

/* ---------- 槽位操作条 ---------- */
.slot-actions {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 10px);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  max-width: calc(100vw - 16px);
  background: rgba(14, 21, 18, 0.96);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 10px 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}
.slot-actions button {
  color: var(--gold);
  font-size: 13px;
  padding: 6px 8px;
  min-width: 52px;
  border: 1px solid rgba(247, 201, 72, 0.4);
  border-radius: var(--r);
}
.slot-actions button.danger-text { color: var(--danger); border-color: rgba(199, 90, 74, 0.5); }

/* ---------- 移除区 ---------- */
.remove-zone {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 8px);
  z-index: 45;
  color: var(--danger);
  border: 2px dashed var(--danger);
  border-radius: 4px;
  background: rgba(30, 12, 10, 0.9);
  padding: 12px 28px;
  font-weight: 700;
}
.remove-zone.hot { background: rgba(199, 90, 74, 0.35); }

/* ---------- 拖拽浮层 ---------- */
#drag-ghost {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, -58%) rotate(-3deg) scale(1.06);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}
#drag-ghost img { width: 72px; height: 96px; object-fit: cover; object-position: center top; border: 2px solid var(--gold); border-radius: 3px; background: var(--panel-deep); }
#drag-ghost .ghost-name { font-size: 11px; color: #fff; background: rgba(0, 0, 0, 0.65); padding: 1px 5px; border-radius: 2px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#drag-ghost.hidden { display: none; }
#drag-ghost .silhouette { position: relative; }

/* ---------- 悬浮速览 ---------- */
#hover-tip {
  position: fixed;
  z-index: 55;
  pointer-events: none;
  background: rgba(10, 14, 12, 0.97);
  border: 1px solid var(--gold-dim);
  border-radius: var(--r);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.7;
  max-width: 220px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
#hover-tip b { color: var(--gold); }
#hover-tip .attr span { color: var(--muted); margin-right: 6px; }
#hover-tip .attr { font-family: "pixel", monospace; font-size: 11px; }

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 8, 6, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }

.sheet, .filter-sheet, .detail-sheet, .onboard {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(180deg, #18261e, #0f1713);
  border: 1px solid var(--gold-dim);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 14px 16px calc(var(--safe-b) + 16px);
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: sheetUp 0.24s ease-out;
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sheet-head b { color: var(--gold); }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

.sheet.small { max-width: 420px; border-bottom: 1px solid var(--gold-dim); border-radius: 4px; margin: auto 14px calc(var(--safe-b) + 30vh); }
.sheet.small p { color: var(--muted); margin: 8px 0; }

/* ---------- 筛选抽屉 ---------- */
.filter-sec { margin-bottom: 10px; }
.filter-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.f-chip {
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--r);
  padding: 6px 10px;
  font-size: 12px;
}
.f-chip.on { color: var(--gold); border-color: var(--gold); background: rgba(247, 201, 72, 0.1); }
.f-chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.legend { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 12px; color: var(--muted); }
.legend summary { color: var(--gold); cursor: pointer; font-size: 12px; padding: 4px 0; }
.legend p { margin: 5px 0; line-height: 1.7; }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 2px; vertical-align: -1px; }
.legend .dot.g { background: var(--t-gold); }
.legend .dot.p { background: var(--t-purple); }
.legend .dot.b { background: var(--t-blue); }
.legend .dot.gr { background: var(--t-green); }
.legend .dot.w { background: var(--t-white); }

.filter-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ---------- 详情弹层 ---------- */
.detail-sheet { padding-bottom: calc(var(--safe-b) + 18px); }
.d-head { display: flex; gap: 12px; margin-bottom: 10px; }
.d-img {
  flex: 0 0 118px;
  width: 118px;
  height: 157px;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  background: var(--panel-deep);
  border: 2px solid var(--tc, var(--gold-dim));
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.5);
}
.d-img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.d-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.d-name { font-size: 17px; font-weight: 700; color: #fff; }
.d-nick { font-size: 12px; color: var(--muted); }
.d-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.d-badge { font-size: 11px; border: 1px solid var(--line); border-radius: 2px; padding: 2px 6px; color: var(--text); }
.d-rating { font-family: "pixel", monospace; font-size: 24px; color: var(--tc, var(--gold)); margin-top: 2px; }
.d-rating small { font-size: 11px; color: var(--muted); font-family: inherit; }

.d-attr { display: flex; gap: 8px; margin: 4px 0 8px; }
.d-attr-item {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 4px;
  text-align: center;
}
.d-attr-item .k { font-size: 10px; color: var(--muted); display: block; }
.d-attr-item .v { font-family: "pixel", monospace; font-size: 15px; display: block; margin-top: 2px; }
.d-attr-item .v.grade-SS, .d-attr-item .v.grade-S { color: #ffd968; }
.d-attr-item .v.grade-A, .d-attr-item .v.grade-S\+, .d-attr-item .v.grade-A\+ { color: #7ce3a1; }
.d-attr-item .v.grade-B, .d-attr-item .v.grade-C { color: #8ac1ff; }
.d-attr-item .v.grade-D { color: #c98a86; }

.d-usage { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.d-usage .u { color: var(--gold); }
.d-usage .un { color: var(--danger); }

.d-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.d-nav .count { font-size: 12px; color: var(--muted); }
.d-nav .arrow-btn { font-size: 22px; color: var(--gold); padding: 4px 12px; border: 1px solid rgba(247, 201, 72, 0.4); border-radius: var(--r); }

.d-slots-label { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.d-slots { display: flex; gap: 5px; }
.d-slots .dock-chip { flex: 1; }
.d-close { display: flex; justify-content: flex-end; margin-top: 10px; }
.d-close button { min-width: 72px; }

/* ---------- 引导 ---------- */
.onboard { text-align: center; }
.onboard-step { margin-bottom: 14px; }
.onboard-step b { display: block; color: var(--gold); font-size: 15px; margin-bottom: 4px; }
.onboard-step p { color: var(--muted); font-size: 13px; }
.onboard .gold-btn { width: 100%; padding: 10px; }

/* ---------- 分享横幅（固定顶部、顶栏之下，避免与底部操作条重叠） ---------- */
#share-banner {
  position: fixed;
  top: calc(var(--safe-t) + 54px);
  left: 12px;
  right: 12px;
  z-index: 33;
  display: flex;
  gap: 6px;
  align-items: center;
  background: rgba(16, 22, 18, 0.96);
  border: 1px solid rgba(247, 201, 72, 0.55);
  border-radius: var(--r);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--gold);
}
#share-banner span { flex: 1; }

/* ---------- Toast ---------- */
#toasts {
  position: fixed;
  top: calc(var(--safe-t) + 56px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.toast {
  background: rgba(10, 14, 12, 0.95);
  border: 1px solid var(--gold-dim);
  border-radius: var(--r);
  color: var(--text);
  font-size: 13px;
  padding: 8px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.22s ease-out;
  display: flex;
  gap: 8px;
  align-items: center;
}
.toast button { color: var(--gold); text-decoration: underline; font-size: 13px; pointer-events: auto; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.out { opacity: 0; transition: opacity 0.2s; }

/* ---------- 桌面端放大 ---------- */
@media (min-width: 860px) {
  .players-grid { gap: 10px; }
  .player-card { min-height: 96px; padding: 10px 8px; }
  .pcard-name { font-size: 15px; }
  .pcard-dot { width: 7px; height: 7px; }
  .slot-name { font-size: 13px; }
  .slots-row { gap: 10px; }
  #dock { padding: 10px 14px; }
}

/* ---------- 无障碍降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.01s !important; }
  #drag-ghost { transition: none !important; }
}

/* ---------- 槽位位置标签 / 复制弹窗 ---------- */
.slot.filled .slot-num {
  background: rgba(0, 0, 0, 0.65);
  padding: 0 3px;
  border-radius: 2px;
  color: var(--gold);
}

.copy-players { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }

.copy-preview {
  background: #0a100d;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: #cfe0d6;
  font-size: 12px;
  line-height: 1.9;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  user-select: text;
  -webkit-user-select: text;
}

.copy-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.copy-actions button { padding: 11px; font-size: 13px; width: 100%; }