/* AUTH */
.auth-view {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
}

.brand-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: rgba(245, 158, 11, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.auth-card h1 { margin: 0 0 6px; font-size: 1.55rem; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 12px;
  margin: 16px 0;
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
}

.auth-card form { display: flex; flex-direction: column; gap: 12px; }

/* APP SHELL */
#main-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-dot { font-size: 1.4rem; }
.topbar-title { font-weight: 700; font-size: 1rem; line-height: 1.1; }
.topbar-sub { font-size: 0.78rem; color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; }

.content {
  flex: 1;
  padding: 14px 12px calc(86px + var(--safe-bottom));
}

.content.no-bottom-nav {
  padding: calc(6px + var(--safe-top)) 6px calc(8px + var(--safe-bottom));
}

.tab-panel {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}

.nav-btn {
  flex: 1;
  max-width: 150px;
  background: none;
  border: none;
  color: var(--muted);
  padding: 9px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-btn .nav-icon { font-size: 1.2rem; }
.nav-btn.active { color: var(--primary); }

/* BIBLIOTHÈQUE */
.library-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-cta-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(23, 28, 38, 1));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-cta-card h2 { margin: 0 0 4px; font-size: 1.1rem; }

.search-cta-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.library-header h3 { margin: 0; font-size: 1rem; }

/* GRILLES & LISTES */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-header h2 { margin: 0 0 2px; font-size: 1.15rem; }

.base-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding-bottom: 16px;
}

.base-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.base-item-img {
  width: 100%;
  height: 185px;
  object-fit: contain;
  background: #05070a;
  cursor: pointer;
}

.base-item-placeholder {
  height: 130px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
}

.base-item-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.base-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 680px;
}

.roster-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 900px) {
  .content {
    padding: 18px 24px calc(86px + var(--safe-bottom));
  }

  .content.no-bottom-nav {
    padding: 10px 18px;
  }

  .base-item-img {
    height: 205px;
  }
}

/* REDESIGN : ZONE DE COMPARAISON ENNEMIE */
.enemy-dropzone {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1.5px dashed rgba(245, 158, 11, 0.55);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.13), rgba(23, 28, 38, 0.96));
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.enemy-dropzone:hover,
.enemy-dropzone.drag-over {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(23, 28, 38, 1));
}

.enemy-dropzone:active {
  transform: scale(0.99);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.dropzone-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropzone-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.workflow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--muted);
}

.step-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
}

.dropzone-cta {
  background: var(--primary);
  color: #111;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .enemy-dropzone {
    flex-wrap: wrap;
  }
  .dropzone-cta {
    width: 100%;
    text-align: center;
  }
}

.library-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

/* MEMBRES CLIQUABLES + GRILLE MODALE MEMBRE */
.roster-card.clickable {
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.roster-card.clickable:hover {
  border-color: rgba(245, 158, 11, 0.55);
  background: var(--surface-2);
}

.roster-card.clickable:active {
  transform: scale(0.99);
}

.roster-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.roster-chevron {
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  margin-left: 2px;
}

.member-bases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

@keyframes tabFadeIn {
  from { opacity: 0.45; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-panel:not(.hidden) {
  animation: tabFadeIn 0.16s ease-out;
}