/* ============================================================
   transfer.css — Module de transfert (transfer.js)
   Réutilise les variables de style.css : --panel, --card,
   --border, --text, --muted, --gold, --cyan, --danger
   Toutes les classes sont préfixées tf- (aucune collision)
   ============================================================ */

/* ---------- Menu contextuel (clic droit) ---------- */
.tf-menu {
  position: fixed;
  z-index: 300;
  min-width: 190px;
  max-width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  padding: 5px;
  animation: tf-pop .12s ease;
}
@keyframes tf-pop {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.tf-menu-head {
  padding: 6px 10px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tf-menu-item:hover {
  background: rgba(240, 180, 41, .14);
  color: var(--gold);
}
.tf-ico { font-size: 14px; }

/* ---------- Feuille latérale ---------- */
.tf-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 320px;
  max-width: 92vw;
  z-index: 250;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -14px 0 36px rgba(0, 0, 0, .45);
  transform: translateX(105%);
  transition: transform .22s ease;
}
.tf-drawer.open { transform: translateX(0); }

.tf-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.tf-ic {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d1119;
}
.tf-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-ic[data-r="Exotic"]    { border-color: #ceae33; box-shadow: 0 0 8px rgba(206, 174, 51, .35); }
.tf-ic[data-r="Legendary"] { border-color: #522f65; }

.tf-meta { min-width: 0; }
.tf-nm {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tf-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 9px;
  background: rgba(87, 199, 227, .14);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tf-x {
  margin-left: auto;
  flex: none;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: all .15s;
}
.tf-x:hover:not(:disabled) { color: var(--danger); background: rgba(224, 82, 82, .12); }
.tf-x:disabled { opacity: .35; cursor: default; }

.tf-body { padding: 14px; overflow-y: auto; flex: 1; }

.tf-src { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.tf-src b { color: var(--text); font-weight: 600; }

.tf-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 14px;
}
.tf-warn {
  font-size: 12px;
  line-height: 1.45;
  color: var(--danger);
  background: rgba(224, 82, 82, .1);
  border: 1px solid rgba(224, 82, 82, .35);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.tf-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

/* ---------- Destinations ---------- */
.tf-dest { display: flex; flex-direction: column; gap: 6px; }
.tf-dest-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all .15s;
}
.tf-dest-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); background: var(--card-hover); }
.tf-dest-btn:disabled { opacity: .4; cursor: default; }
.tf-arrow { margin-left: auto; color: var(--muted); flex: none; }
.tf-dest-btn:hover:not(:disabled) .tf-arrow { color: var(--gold); }
.tf-dest-btn .tf-spin { margin-left: auto; }

.tf-load { display: flex; justify-content: center; padding: 14px 0; }

/* Spinner */
.tf-spin {
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, .22);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: tf-rot .7s linear infinite;
}
@keyframes tf-rot { to { transform: rotate(360deg); } }

/* Erreur dans la feuille */
.tf-error {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--danger);
  background: rgba(224, 82, 82, .1);
  border: 1px solid rgba(224, 82, 82, .35);
  border-radius: 8px;
  padding: 8px 10px;
}
.tf-error[hidden] { display: none; }

/* ---------- Toast ---------- */
.tf-toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 400;
  padding: 10px 18px;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.tf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tf-toast.err { border-color: var(--danger); color: var(--danger); }

@media (max-width: 820px) {
  .tf-drawer { width: 100%; max-width: 100vw; border-left: none; }
}
